Commit 9a602f7
committed
fix(discord): PluralKit DM pairing identity + direct peer regex (#86332)
Bug 1: resolveDiscordDmPreflightAccess passed the raw gateway author
to handleDiscordDmCommandDecision while the access check used the
resolved (PK-aware) sender identity. The two diverge for PluralKit
users — the pairing record was keyed by the Discord user id while
the ingress resolver looked it up by PK member UUID. Result: every
inbound DM from a PK user triggered a fresh pairing challenge.
Bug 2: extractDiscordSessionKind regex matched 'dm' but not 'direct',
which is the canonical peer kind used for normalized DM session keys.
No visible breakage today because all callers compare against 'dm',
but a latent fragility for any future caller that distinguishes
'direct' from null.
- Pass params.sender (resolved identity, includes PK UUID) to the
pairing decision so the record key matches the lookup key.
- Extend the kind regex to accept 'direct' and map it to 'dm'.
Closes #863321 parent 35dcd42 commit 9a602f7
2 files changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
82 | 87 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
| |||
0 commit comments