Repository navigation
feat(database): follow the bot's V7 contract to 788939a - #477
Conversation
The bot added appeals, the honeypot, log options, five log channels, the Polls rule and the ModerationAction indexes, and dropped modules.logs, modules.commands, logs.command and logs.settings from its settings. columns.ts and constants.ts follow the bot's files again. Logs is no longer a module, the new log channels are in the Channels groups, export and import carry every portable setting the bot has with its limits, and the rule editor offers Polls and the perChannel option.
Architecture Inside the changed components — 1 viewComponent view — Settings pipeline Internal validation, mapping, and persistence boundaries of guild settings. Data flow Review ✨ Nothing flagged · reviewed Tip Set 🪧 More tips
Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out on X, Bluesky, Mastodon, Reddit or LinkedIn |
🤖 REVIEW PAUSED
This pull request is from an outside contributor. Add the
Only Wolfstar's click starts work. It adds the |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
ℹ️ No critical issues — one rough edge worth a look.
Reviewed changes
Initial review of the whole PR (single commit). Locale JSON and schema files are generated and were skimmed only; the vendor submodule bump itself can't be checked here.
- Settings contract —
columns.ts,constants.tsandtypes.tsadd the appeals, honeypot and log options tables and keys, and dropmodulesLogs,modulesCommands,logsCommandandlogsSettings. - Validation — new validators for
timezone,honeypotAction,logsMessageUpdateStyle,moderationConfirmRecentMinutesandappealsQuestions. - Export and import —
TransferableSettingscarries the portable keys the bot has. - Dashboard — Logs is no longer a module (sidebar, setup, module registry), five new log channels are grouped in
Channels.vue, and the rule editor gainsPollsandperChannel. - Audit — legacy labels kept for the removed keys.
I checked that normalizeAutoModerationRuleOptions is generic over the defaults, so perChannel and Polls need no extra server code, and that no source file outside the legacy audit labels still references the removed keys.
ℹ️ commandsRestrictions: null bypasses the "refused on writes" guard
The PR says commandsRestrictions is refused on writes, and the new test checks that for []. parseSettingsChanges() handles value === null before it calls the validator, so a PATCH with { commandsRestrictions: null } resets the column to [] and wipes data the bot's /commands modal owns. The refusal itself comes from validatorFor() falling through, which is easy to lose on a later refactor.
Technical details
# `null` resets a bot-owned setting
## Affected sites
- `server/database/settings/validation.ts` `parseSettingsChanges()` — the `value === null` branch runs before `validate(value)`, so a key with no dashboard validator is still reset to its default.
- `test/unit/server/database/settings-validation.spec.ts` ("refuses the settings only the bot edits") — only passes `[]`, never `null`.
## Required outcome
- A write to `commandsRestrictions`, including `null`, is refused with the same "cannot be changed from the dashboard" error.
- The test covers `null` as well as `[]`.
## Suggested approach (optional)
- Make the bot-only set explicit (e.g. a `BOT_ONLY_KEYS` set shared by the validator and the test) and reject those keys before the `null` branch.claude-sonnet-5-5 | 𝕏
A null in a settings request reset commandsRestrictions to [] before its validator ran, wiping what the bot's /commands modal wrote.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the one commit pushed since the prior pullfrog review (65ec586..4a6bdb0).
- Bot-only settings guard —
validation.tsnow exportsBOT_ONLY_SETTINGS(commandsRestrictions) and a sharedrefusevalidator.validatorFor()returns it for those keys and for the final fallthrough, andparseSettingsChanges()skips thenullreset when the validator isrefuse, so{ commandsRestrictions: null }is refused like any other write. This resolves the concern from the prior review. - Test coverage —
settings-validation.spec.tsimportsBOT_ONLY_SETTINGSinstead of a local copy and checks both[]andnullagainst the refusal message.
claude-sonnet-5-5 | 𝕏
…ot does The bot keeps appeal questions of any length and count, so a backup it exported failed to import here. The updates channel moves a follow of the support server's announcements that only the bot sets up, so the dashboard no longer writes it.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the one commit pushed since the prior pullfrog review (4a6bdb0..c903119).
updatesChannelis bot-only —BOT_ONLY_SETTINGSnow includesupdatesChannelnext tocommandsRestrictions, sovalidatorFor()returnsrefuseand anullreset is refused too. Nothing inapp/writes the key and it is not in the transferable list, so imports can't reach it either.- Appeal questions match the bot —
validateAppealQuestionsaccepts any text and only drops duplicates, so a bot export with long, blank or more than five questions imports instead of failing the whole file. - Tests — the bot-only test also checks
updatesChannelwith[],nulland a channel id, andsettings-transfer.spec.tsround-trips a 1001-character question.
claude-sonnet-5-5 | 𝕏

Stacked on #451.
🔗 Linked issue
Related to #451.
🧭 Context
vendor/wolfstarwas pinned 117 commits behind the bot'sV7. Since then the bot added tables and columns (appeals, honeypot, log options, five more log channels, thePollsrule, theModerationActionindexes from wolfstar-project/wolfstar#313), and it droppedmodules.logs,modules.commands,logs.commandandlogs.settingsfrom its settings because they turned nothing off.📚 Description
The submodule now points at
788939a.columns.tsandconstants.tsfollow the bot's files key for key.timezone,honeypot.*,appeals.*,logs.message-update-style,moderation.track-roles, …), checked with the bot's limits. Before, a bot file withtimezonewas reported as unsupported.Pollsand theperChanneloption of message spam.modulesLogs,logsCommandorlogsSettingskeep their labels.Two settings are refused on writes, a
nullreset included.updatesChannelmoves the follow of the support server's announcements, which only the bot sets up (syncUpdatesChannelFollow).commandsRestrictionsbelongs to the bot's/commandsmodal, and I did not port its shape. The contract types its column as plain JSON, which is recursive, andRef<GuildData>hit "Type instantiation is excessively deep", soGuildDatakeeps it asunknown[]. Happy to type it properly if the dashboard should edit restrictions later.There is no UI yet for the honeypot, appeals, time zone or the new moderation switches. They can be set from the bot and survive an export, but I'd rather add their sections in their own PRs.


Confidence Score: 5/5
No merge-blocking issues remain. Both previously reported problems are addressed in the current code.Summary
This PR updates the dashboard to the bot’s V7 settings contract at
788939a.No outstanding findings remain, and no merge-blocking issues were identified. Tests were inspected, not run.
Reviews (2) · Last reviewed commit: "fix(database): take the appeal questions..." · Reviewed by Greptile