Skip to content

[Fix] Model settings repeatedly retry when a save fails - #2305

Merged
roomote-roomote[bot] merged 1 commit into
developfrom
fix/model-settings-save-retry-2zq6caqicgljt
Sep 7, 2026
Merged

[Fix] Model settings repeatedly retry when a save fails#2305
roomote-roomote[bot] merged 1 commit into
developfrom
fix/model-settings-save-retry-2zq6caqicgljt

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @daniel-lxs. View the task or mention @roomote-roomote for follow-up asks.

Related issue

No linked issue; maintainer-authorized model-settings recovery investigation.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

A rejected model-settings save escaped the error handler and immediately retried the unchanged unsaved draft. One preset Apply generated 138 update attempts in a real local browser before the probe was stopped.

What changed

Catch failed saves, restore the last saved draft when available, clear queued retry state, and show the existing generic failure message. Explicitly stop automatic retries after transport or validation failure, including when no saved baseline exists. Successful queued-save behavior is unchanged, and a later deliberate edit can retry normally.

How it was tested

Base d95a5fd045ff82f81d458256a6a871ec9cda611a; exact head 84f0e5eacbaadf6ba775af7464c7d63f8ccb7d65.

  • Real /settings/models stimulus: select a mapping preset and Apply while the browser aborts taskModels.update requests. Baseline produced 138 attempts before closure. Final diff produced exactly one attempt, the error toast, and restoration of all 16 observed controls. A second deliberate Apply at mobile width produced one additional attempt (total 2), again restored controls. Counts remained stable over bounded two-second observation windows.
  • Failure injection is explicit: request abort plus a forwarding fetch counter and read-only DOM observation. No save reached the backend and no provider/credential was changed. Browsers were closed with the abort still installed.
  • Regression failed before the fix with unhandled rejection/no error toast. All 38 ModelSettingsSection tests pass after the fix, including rollback, a deliberate successful retry at the mutation boundary, and existing successful preset behavior: pnpm exec dotenvx run -f .env.test -- pnpm --filter @roomote/web exec vitest run src/components/settings/ModelSettingsSection.test.tsx.
  • Web fast typecheck and diff checks passed. Actual commit/pre-push hooks passed formatting, full oxlint, residual ESLint, fast typechecks and knip (existing non-failing mint hint).
  • Final-diff desktop/mobile images were inspected; no source drift. They prove error/rollback appearance under the disclosed failed request, not successful backend persistence. The pre-existing optimistic preset-applied toast can still precede the failure toast; this PR does not redesign that copy.
  • Full repository tests, deployed behavior, concurrent editing races and a server commit followed by a lost response were not exercised.

Screenshots

Actual local desktop UI with injected save-request failure:

Model save error and restored controls on desktop

Actual local mobile UI after a second deliberate action under the same failure:

Model save error and restored controls on mobile

Related PRs

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

Full pre-push static gates passed; exact full formatting-inclusive lint and full tsc were not both run. No changeset added in this bounded fix.

@roomote-community

Copy link
Copy Markdown
Contributor

Reviewing the PR now. Follow

Reviewing 84f0e5e

@daniel-lxs
daniel-lxs marked this pull request as ready for review September 7, 2026 03:18
@roomote-roomote
roomote-roomote Bot merged commit 098e909 into develop Sep 7, 2026
16 of 17 checks passed
@roomote-roomote
roomote-roomote Bot deleted the fix/model-settings-save-retry-2zq6caqicgljt branch September 7, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant