Repository navigation
fix(preferences): retry failed preference sync and catch empire state patch - #566
Merged
Merged
Conversation
… patch - retry a failed PATCH /user/preferences/ once on the next debounce, with the current preferences and the same session guard - catch the PatchEmpireState call in EmpireView (no unhandled rejection) - test the retry-once path in usePreferences.sync.test.ts Closes #562 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · +0.03% coverage variation
Metric Results Coverage variation ✅ +0.03% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (f053000) 3713 3625 97.63% Head commit (5e1487b) 3715 (+2) 3628 (+3) 97.66% (+0.03%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#566) 2 2 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
✅ Deploy Preview for prunplanner-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
What and why
A failed
PATCH /user/preferences/was only logged to the console, so the server kept stale preferences until the user changed another one; and thePatchEmpireStatecall at the end ofcalculateEmpirehad no catch, surfacing network errors as unhandled rejections. Found by/error-review(PostHog and Axiomclient_errornetwork events on/empire, release 0.31.1).Changes
usePreferences.ts: on a failed sync, reschedule it once on the next debounce with the current preferences (same session guard, so it is dropped after logout); a second failure is not retried.EmpireView.vue:.catch(console.error)on thePatchEmpireStatecall (the state is recomputed and re-sent on the next calculation).usePreferences.sync.test.ts: test that a failed sync is retried exactly once (fails without the fix).How it was verified
pnpm test: 118 files, 3712 passed, 1 expected failpnpm tsc: passpnpm lint: passpnpm knip: passCloses #562
🤖 Generated with Claude Code