Skip to content

fix(#284): preserve custom instruction selection while loading - #304

Closed
bellussi1 wants to merge 2 commits into
hydropix:mainfrom
bellussi1:fix/284-preserve-pending-custom-instruction
Closed

bellussi1 wants to merge 2 commits into
hydropix:mainfrom
bellussi1:fix/284-preserve-pending-custom-instruction

Conversation

@bellussi1

Copy link
Copy Markdown

Fixes #284.

The server-synced preference path could apply a saved custom instruction before loadCustomInstructions() populated the dropdown. Since the template already contains its default options, the pending selection was treated as missing and discarded.

Keep the selection pending until the customInstructionsLoaded event fires. If the preset exists, restore it; if the list has finished loading and the preset is absent, log and clear the stale value.

Verification:

  • Started translation_api.py and confirmed the homepage returned HTTP 200.
  • node --check src/web/static/js/core/settings-manager.js
  • git diff --check
  • Automated tests were not run.

@hydropix

Copy link
Copy Markdown
Owner

Thanks a lot for this, Enzo, and sorry for the slow turnaround. Your diagnosis was right: the dropdown is never empty because of the built-in None and Auto options, so the pending preset was dropped too early. The fix landed in #312, which takes the same approach (keep the selection pending until the instruction list has loaded) and also stops the preference auto-save from syncing the default value back to the server while the preset is still pending, since that is what spread the loss to other devices. As #312 covers this, I'm closing this one. Thanks again for digging into it.

@hydropix hydropix closed this Oct 23, 2026
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.

Web UI: selected custom instruction is sometimes dropped on page load (race with synced preferences)

2 participants