fix(ticket): archive namespace isolation + no-ping transcripts (v3.1.42)#6
Conversation
Two archive bugs reported from prod.
1. Wrong-user archive: ticket archives are grouped per user (createdBy for
normal tickets, emailSender for email-import tickets). But an email-import
ticket's createdBy is the importing admin, not the player — so a normal
ticket the admin opened could match (and append into) an email-import
archive sharing their createdBy, landing one user's ticket in another's
thread. findExistingArchive now scopes each lookup to its own namespace via
the isEmailTicket discriminator (email→{isEmailTicket:true,emailSender},
normal→{isEmailTicket:false,createdBy}), so the two can never cross.
2. Archived transcripts could ping people. Every forum post in BOTH the ticket
and application archive paths now uses allowedMentions:{parse:[]}, and
message content is captured via cleanContent — mentions render as readable
@name/#name text instead of raw <@id>, and @everyone/@here/user/role can
never notify when historical content is re-posted.
Verified: tsc clean, biome clean, bun test 1172/0 (closeWorkflow 12/0 incl. a
new cross-namespace regression test; updated the email-ticket lookup assertion).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis patch (v3.1.42) fixes archive thread scoping for email-import vs. normal tickets and suppresses Discord mentions in archived transcripts. Email-import and normal tickets now use separate archive namespaces via ChangesArchive and Transcript Mention Handling
🎯 2 (Simple) | ⏱️ ~12 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Two archive bugs reported from prod.
1. Wrong-user archive (the email-import collision). Ticket archives group per user —
createdByfor normal tickets,emailSenderfor email-import tickets. But an email-import ticket'screatedByis the importing admin, not the player, so a normal ticket the admin opened could match (and append into) an email-import archive sharing theircreatedBy→ one user's ticket lands in another's thread.findExistingArchivenow scopes each lookup to its own namespace via theisEmailTicketdiscriminator, so email-import and normal archives can never cross-contaminate.2. Archived transcripts could ping people. Every forum post in the ticket and application archive paths now uses
allowedMentions: { parse: [] }, and content is captured viacleanContent(mentions render as readable@name/#name, not raw<@id>). Historical transcript content can never notify users/roles or fire@everyone/@here.Verified: tsc clean, biome clean,
bun test1172/0 (closeWorkflow 12/0 incl. a new cross-namespace regression test).🤖 Generated with Claude Code
Summary by CodeRabbit
@everyone/@here alerts.