Repository navigation
fix: stale client state and silent request failures - #321
Merged
Merged
Conversation
bugs-mailbox-provider-no-refetch The provider's fetch effect ran once; on an account switch the reset handler set isLoading=true and never refetched, leaving the skeleton and an empty mailbox until a hard reload. No test: the fix lives in a React provider effect and the repo has no component test harness; verified by tsc and by tracing the reset path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-drive-cache-not-cleared-on-session-change Sign-out or account switch does not reload the page, so /drive could render a stale cached listing. Clear it on AUTH_SESSION_CHANGED_EVENT like the other caches. Test: tests/drive-cache.test.mjs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-message-list-caches-error-response A JSON 4xx/5xx from /api/messages was cached as the list and blanked the open folder to 'no messages' on every remount. fetchMessageList now rejects non-OK responses without caching, and useMessages keeps the list already shown. Sidebar counts are unchanged: a failed counts request is not cached, and keeping the previous mailbox's counts after a mailbox switch would be wrong. Test: tests/message-list-cache.test.mjs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le name bugs-profile-recovery-stale-name The recovery form re-sent the name loaded when the page opened, so renaming and then saving the recovery email reverted the name (user, primary mailbox, self contacts). name is now optional on PATCH /api/settings/profile and the recovery save omits it. Test: tests/profile-schema.test.mjs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…equest aborts bugs-import-upload-hangs-non-json A proxy HTML 413/502 made JSON.parse throw inside onload, so the promise never settled and the import button stayed on 'Importing'. Parse defensively and reject on abort/timeout. Test: tests/import-upload-response.test.mjs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fails bugs-setup-forms-stuck-loading A dropped connection or an HTML 5xx during first-run setup made fetch or res.json() reject before setLoading(false)/setDomainChecking(false) ran, leaving the button disabled with no error. Handlers now use try/catch/finally with auth.serverUnreachable, and the setup utils tolerate non-JSON bodies via readResponseJson. Test: tests/response-json.test.mjs (body parsing); the handlers are React event handlers with no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-contact-edit-stale-avatar-flag The edit dialog read hasAvatar from the contact snapshot taken on open, so after uploading a photo 'Remove' never appeared, and after removing one it still did (a second remove errored). No test: React state in a dialog form; no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-stale-response-loaders After switching mailbox or message, a slow response for the previous id could land last and show its reminders/status (and act on the new id). Only the newest request now sets state. No test: effect-local request counter in React components; no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-drive-share-stale-response Opening Share on a second item while the first item's response was slow showed the first item's people and public link in the second dialog (and 'Disable link' then posted to the second item). Responses are now dropped once the item changes, and a network failure shows the existing error toast instead of an unhandled rejection. No test: effect cleanup in a React dialog; no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-branding-preview-leak After saving, the preview object URL stayed alive and the file input kept its value, so choosing the same file again fired no change event. The preview is now revoked and the input cleared after a save, and the URL is revoked on unmount. No test: browser object-URL and file-input handling in a React page; no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-turnstile-loader-failure A blocked script stayed in the DOM, so a second mount waited on its load event forever and the first caller raised an unhandled rejection. The failed script is now removed, waiters also reject on error, and the loader call has a catch so a later mount retries. No test: DOM script loading in a client component; no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bugs-takeout-continues-after-unmount Navigating away mid-import left the upload loop running with no progress UI or Stop button, and a second import could then run concurrently. The controller is now aborted on unmount; progress is already saved for resuming. No test: effect cleanup in a React component; no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
perf-forward-icon-recreated-each-render Forward called createIcon (forwardRef) on every render, a new component type each time, so React remounted the SVG on every parent render (message actions, rules rows). Hoisted to module scope; className now goes through cn() instead of rendering 'undefined scale-x-[-1]'. No test: JSX icon wrapper; no component harness in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/hooks/utils.ts
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes for stale client state and requests that hang or fail silently.
nameis now optional onPATCH /api/settings/profile.Tests: drive cache, message list cache, profile schema, import upload response, response JSON helper. The remaining changes are React effects with no component harness. Rebased on current
main: tsc is clean, lint has 0 errors, andnode --testpasses 687 of 689 (2 skipped).🤖 Generated with Claude Code