Conversation
We hit subrequest limits on this so let's do it in smaller batches that the client initiates ### Change type - [x] `other` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Switch user migration to server-limited batches (50/users per run) and auto-chain batches on the client via SSE, with stop support and hasMore signaling. > > - **Admin UI (`apps/dotcom/client/src/pages/admin.tsx`)**: > - Batch migration now runs in incremental batches: wraps SSE flow in `startBatch()` Promise and auto-starts next batch when `data.hasMore` is true. > - Adds `shouldContinueRef` to allow stopping between batches; updates stop logic and error handling. > - Maintains capped progress log and updates stats from SSE `details`. > - **Sync Worker (`apps/dotcom/sync-worker/src/adminRoutes.ts`)**: > - `GET /app/admin/migrate_users_batch`: includes `hasMore` in completion events. > - `startUserMigration(...)`: processes up to `batchSize = 50` users per invocation, returns `boolean` indicating remaining work; adds `processedCount` loop and final remaining-users check. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 264c093. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
I realised I wasn't really comfortable leaving this running on its own in case something did go wrong and I'd have to do more manual durable object restarts. this makes it stop as soon as any error happens and it saves the error message in indexeddb so even if the page refreshes I should be able to find the email associated with the error and do a manual restart or investigate what went wrong if something else went wrong. ### Change type - [ ] `bugfix` - [ ] `improvement` - [ ] `feature` - [ ] `api` - [x] `other` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Stops batch user migration on first failure and saves SSE failure events to IndexedDB for later inspection. > > - **Backend**: > - `startUserMigration` in `apps/dotcom/sync-worker/src/adminRoutes.ts` now emits a `failure` event with details, then a `summary` event, and returns `false` to stop processing immediately on error. > - **Frontend**: > - `apps/dotcom/client/src/pages/admin.tsx` `BatchMigrateUsersToGroups` makes `EventSource.onmessage` async and, on `failure` steps, calls `saveMigrationLog` to persist entries. > - Adds `apps/dotcom/client/src/pages/migrationLogsDB.ts` implementing an IndexedDB (`idb`) store to save migration error logs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit df8939e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Resolves #5697 > Inline editing of frame labels isn't a very good experience on mobile. Instead, when you tap a frame label, we should open a window.prompt instead. > On mobile devices, attempting to edit a frame label opens a window.prompt populated with the current name. Ok/cancel do what you would expect. > On desktop devices, the frame label can be edited inline as it is now Detection of mobile devices via PORTRAIT_BREAKPOINT.MOBILE ### Change type - [ ] `bugfix` - [x] `improvement` - [ ] `feature` - [ ] `api` - [ ] `other` ### Test plan 1. Double click frame on mobil device (or via mobile developer tools) 2. Rename frame via opened window.prompt ### Release notes - Use window.prompt to change frame label on mobile <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Use window.prompt to rename frames/pages on small coarse-pointer devices and add Vitest mocks for breakpoints/translations. > > - **UI** > - **Frame rename (`FrameLabelInput.tsx`)**: > - Switch to `window.prompt(msg('action.rename'))` for renaming when `breakpoint < PORTRAIT_BREAKPOINT.TABLET_SM` and `isCoarsePointer`. > - Disable inline input and autofocus in that mode; refactor rename logic into `renameFrame`. > - **Page menu (`DefaultPageMenu.tsx`)**: > - Use the same `shouldUseWindowPrompt` condition to rename pages via `window.prompt(msg('action.rename'))` in editing and submenu flows. > - Replace hardcoded strings; remove platform check in favor of breakpoint/coarse-pointer logic. > - **Tests** > - **Vitest setup (`setupVitest.js`)**: mock `useBreakpoint` and translation hooks to provide defaults during tests. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 06c1f1d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: swdev33 <18295918+swdev33@users.noreply.github.com> Co-authored-by: Mime Čuvalo <mimecuvalo@gmail.com>
…7086) hmm ### Change type - [x] `other` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Wrap per-user migration in a retry to reduce flakes in the admin batch user migration flow. > > - **Admin migration batch (`apps/dotcom/sync-worker/src/adminRoutes.ts`)**: > - Wrap per-user migration logic in `retry(...)`: > - Executes `migrate_user_to_groups(...)` and `admin_forceHardReboot(...)` within the retry block. > - Maintains progress reporting and success/failure handling. > - Import `retry` from `@tldraw/utils`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b826be2. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )