Fix Include Tag Descriptions toggle reverting on click#191
Merged
Conversation
The handleUpdate function was calling setSettings(updated) with the raw API
response. If the API response contained stale/incorrect data (due to race
conditions like concurrent settings updates), the toggle would flip back to off.
Fix:
1. Merge user's intended changes into the API response: setSettings({...updated, ...updates})
This ensures the toggle stays in the user's chosen state even if the API
response has stale data from a concurrent update.
2. Add null check for the API response to prevent invalid state if the API
unexpectedly returns nothing.
Co-authored-by: SlayterDev <1760134+SlayterDev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with tag description setting toggle
Fix Include Tag Descriptions toggle reverting on click
Mar 3, 2026
SlayterDev
added a commit
that referenced
this pull request
Mar 13, 2026
* Initial plan
* Fix tag description toggle: preserve user's change after API response
The handleUpdate function was calling setSettings(updated) with the raw API
response. If the API response contained stale/incorrect data (due to race
conditions like concurrent settings updates), the toggle would flip back to off.
Fix:
1. Merge user's intended changes into the API response: setSettings({...updated, ...updates})
This ensures the toggle stays in the user's chosen state even if the API
response has stale data from a concurrent update.
2. Add null check for the API response to prevent invalid state if the API
unexpectedly returns nothing.
Co-authored-by: SlayterDev <1760134+SlayterDev@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SlayterDev <1760134+SlayterDev@users.noreply.github.com>
Co-authored-by: Brad Slayter <SlayterDev@users.noreply.github.com>
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.
The "Include Tag Descriptions" toggle in Settings immediately reverted to off after being enabled. The
handleUpdatefunction replaced optimistic state with the raw API response viasetSettings(updated)— if the response contained stale data (e.g. from a race withfetchOllamaModelsinvoking a stalehandleUpdateclosure), the user's change was silently undone.Changes
SettingsPage.tsx—handleUpdate: After a successful API call, merge the user's intended changes over the response rather than replacing state entirely:updated: PreventssetSettings(undefined)from crashing the component when the API returns an empty body in unexpected scenarios.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.