-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Config UI: publish updated sponsor and interval values, reboot hint #25038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…UI visibility Co-authored-by: naltatis <[email protected]>
Co-authored-by: naltatis <[email protected]>
Co-authored-by: naltatis <[email protected]>
…r test Co-authored-by: naltatis <[email protected]>
Co-authored-by: naltatis <[email protected]>
Co-authored-by: naltatis <[email protected]>
Co-authored-by: naltatis <[email protected]>
Co-authored-by: naltatis <[email protected]>
|
@copilot three playwright tests are failing. fix them: |
…vior Co-authored-by: naltatis <[email protected]>
... Fixed in cfc1d5c. The tests were failing because:
All three tests should now pass. |
|
@copilot looks good. now cleanup the PR description. make it concise. |
Updated PR description to be more concise - removed verbose progress tracking and redundant details, kept only essential information about the problem, solution, and changes. |
| } | ||
|
|
||
| // TODO find better place | ||
| settings.SetString(keys.SponsorToken, req.Token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imho we should move this and the channel handling into a sponsor function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can refactor this into a helper function. Would you prefer a function in the sponsor package that handles both the database save and websocket publish, or a local helper in the handler file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot move this saving and publishing logic to the sponsor package. Pass uiChan to package on init.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5aaa62d. Moved sponsor token saving and publishing logic to the sponsor package:
- Added
sponsor.Init(valueChan)called inRegisterSystemHandler - Created
sponsor.SaveToken()andsponsor.DeleteToken()functions that handle database persistence and websocket publishing - Updated handlers to use these new functions
- Removed valueChan parameter from sponsor handlers
|
@copilot Changed files are visible from the diff itself. |
Removed the Changes section from PR description since the diff shows the modified files. |
Co-authored-by: naltatis <[email protected]>
Fix: Publish sponsor and interval updates to websocket for immediate UI visibility
Fixes #24967
Problem
When configuring sponsor token or control interval via GUI, changes were saved to database but not reflected in UI until restart.
Root Cause
HTTP endpoints (
/sponsortoken,/interval) set thedirtyflag but failed to publish updates to the websocket channel (valueChan), so the UI store state wasn't updated.Solution
Modified handlers to publish updates via websocket:
settingsSetDurationHandler- publishes interval changessponsor.SaveToken/sponsor.DeleteToken- handle token persistence and publish sponsor status updatesTesting
E2e tests verify that values are immediately visible in the UI after save and that the restart banner appears (dirty state is set).
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.