test
This commit is contained in:
@@ -8,7 +8,7 @@ Node.js (CommonJS) Discord ticketing bot for Indifferent Broccoli. Single proces
|
||||
|
||||
- A discord.js v14 client (ticket lifecycle, slash/button/modal handlers, context menus)
|
||||
- A Gmail bridge (~30s polling → Discord channels; staff replies → Gmail)
|
||||
- A Mongoose/MongoDB Atlas layer (`broccoli_db`) for tickets + settings
|
||||
- A Mongoose/self-hosted MongoDB layer (`broccoli_db`) for tickets + settings
|
||||
- Two Express servers: healthcheck + bOSScord API (`PORT`, default 5000 → host 8892), and an internal settings API (`INTERNAL_API_PORT`)
|
||||
- Background jobs: auto-close, unclaimed reminders, auto-unclaim, pattern detection, surge detection, chat monitoring, orphan reconciliation
|
||||
|
||||
@@ -335,7 +335,7 @@ ticketSchema.index({ ticketNumber: 1 });
|
||||
`discordThreadId` should be `unique, sparse` because Discord-only tickets set it immediately, email tickets may briefly lack it during creation, and no two tickets should share a channel. Confirm the sparse-unique behavior doesn't conflict with existing data before enabling (see Verify).
|
||||
**Verify:**
|
||||
- Before deploy, run `db.tickets.aggregate([{$group: {_id: "$discordThreadId", c: {$sum: 1}}}, {$match: {c: {$gt: 1}}}])` against `broccoli_db` to confirm no duplicate `discordThreadId` values exist. If any do, investigate (they indicate prior orphaning bugs) before adding the unique index.
|
||||
- After redeploy, run `db.tickets.getIndexes()` in Atlas and confirm all five new indexes exist.
|
||||
- After redeploy, run `db.tickets.getIndexes()` via mongosh and confirm all five new indexes exist.
|
||||
- Spot-check with `db.tickets.find({discordThreadId: "<some id>"}).explain("executionStats")` — should show `IXSCAN`, not `COLLSCAN`.
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user