• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

VolvoxLLC / volvox-bot / 25934318987

15 May 2026 06:23PM UTC coverage: 90.888% (-0.02%) from 90.903%
25934318987

push

github

web-flow
refactor(moderation): deduplicate SQL, extract shared helpers, fix protection gap (#927)

* refactor(moderation): deduplicate SQL, extract shared helpers, fix protection gap

DUP-1: Extract insertModCase() in moderation.js to eliminate duplicated
       advisory-lock + INSERT SQL between createCase and createWarnCaseWithWarning.

DUP-2: createWarnCaseWithWarning now delegates to warningEngine.createWarning()
       (which accepts an optional { client } param for transaction support)
       instead of inlining the warnings INSERT.

DUP-3: Extract getBanTarget() in modAction.js — ban.js and tempban.js
       shared identical getTarget implementations.

DUP-4: warnings API /user/:userId route now delegates to
       getWarnings() and getActiveWarningStats() from warningEngine.js
       instead of inlining queries (also fixes missing expires_at guard).

DUP-5: Extract getConfiguredRoleIds() in permissions.js — centralises
       the mergeRoleIds calls duplicated in moderation.js and modExempt.js.

DUP-6: Extract getPoolSafe() in db.js — replaces identical try/catch
       wrappers in modAction.js and aiAutoMod.js.

DUP-7: quietMode.js parseDurationFromContent short-form branch now
       delegates to parseDuration() from duration.js.

DEAD-1: Remove unused _durationMs from tempban extractOptions.
DEAD-2: Remove unused _severity from warn extractOptions.

ARCH-2: modExempt.isExempt now checks protectRoles.roleIds so that
        protected roles are also exempt from automated moderation
        (AI auto-mod, rate limiting, link filters).

* fix(tests): update mocks for getPoolSafe and warningEngine changes

- Add getPoolSafe mock to unlock.test.js (modAction now imports it)
- Mock warningEngine.getWarnings/getActiveWarningStats in warnings API
  test (route now delegates to warningEngine instead of inline SQL)

* fix(review): address Copilot feedback on PR #927

- Move orphaned createCase JSDoc to the correct function (moderation.js)
- Add @param for option... (continued)

10885 of 12625 branches covered (86.22%)

Branch coverage included in aggregate %.

25 of 31 new or added lines in 9 files covered. (80.65%)

2 existing lines in 1 file now uncovered.

16795 of 17830 relevant lines covered (94.2%)

167.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.93
/src/modules/welcomeDynamicContext.js


Build SHA Not Found

The commit SHA "4ca39e6b031f5ed3761dddef071fdd58fd73649c" was not found in your repository, so the file cannot be loaded. This may be because you posted from a local development environment, or your CI created an ephemeral commit.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc