Commit fc8a52c
authored
fix admin_migrateToGroups (tldraw#7049)
testing this some more in production I noticed that it was not
effectively clearing the cache data for users who aren't signed in and
active. That's because if they aren't connected there's no cache so the
reboot doesn't get called. this fixes that.
### Change type
- [x] `other`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Deletes the user's R2 snapshot before rebooting in
`admin_migrateToGroups` to properly reset cache for offline users, and
adds more detailed debug logs around migration and reboots.
>
> - **Sync Worker**
> - **Migration flow**
(`apps/dotcom/sync-worker/src/TLUserDurableObject.ts`):
> - Delete user snapshot
`USER_DO_SNAPSHOTS.delete(getUserDoSnapshotKey(...))` before cache
reboot in `admin_migrateToGroups` to ensure fresh state.
> - Add debug logs: start, result, and completion of migration.
> - **Reboot logging**
(`apps/dotcom/sync-worker/src/UserDataSyncer.ts`):
> - Expand `reboot` debug message to include `hard` and `delay` flags.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
65e16b9. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 40241b3 commit fc8a52c
2 files changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
568 | 569 | | |
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
573 | 574 | | |
574 | 575 | | |
575 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
576 | 579 | | |
577 | 580 | | |
| 581 | + | |
| 582 | + | |
578 | 583 | | |
579 | 584 | | |
580 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
0 commit comments