Repository navigation
Commit b53b02e
committed
fix(cleanup): skip chat attachments whose key is not a string
`collectChatFiles` accepted any truthy `fileAttachments[].key` and then called
string methods on it, so one message row carrying a numeric or object key
threw and failed the whole chat purge, leaving every other key of the batch
behind. It now uses the same guard as the reference check in
`chat-cleanup.ts` (`isRecordLike` plus a non-empty string key) and skips the
entry.
Autopsy: the purge tests only fed well-formed attachments; message content is
untyped jsonb written by several clients, and the cast to string hid the gap
from type-check. The new case fails on the old code with
`key.startsWith is not a function`.1 parent 099fad8 commit b53b02e
2 files changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
83 | 94 | | |
84 | 95 | | |
85 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 153 | + | |
| 154 | + | |
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
| |||
0 commit comments