Commit 333a1aa
fix(worker): log fail-closed permission cleanup
When the account-driven permission syncer's catch fires (401/403/410/
token-refresh), it silently wipes the account's AccountToRepoPermission
rows before re-throwing. Operators can see the upstream error in three
sinks already, but there's no signal that the *cleanup* itself ran —
forcing a before/after row count to verify behavior.
Switch the cleanup to a direct `accountToRepoPermission.deleteMany` so
we get the deleted row count, and emit a warn log with the account id,
user email, which predicate matched, the count, and the original error
message. Behavior is equivalent to the prior `account.update` form
(same DELETE WHERE accountId=...).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fd242f7 commit 333a1aa
1 file changed
Lines changed: 12 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
211 | 208 | | |
| 209 | + | |
| 210 | + | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
| |||
0 commit comments