Repository navigation
Offer to refresh a page when its server's rebuilt, and take the config a page has read - #203
Merged
Merged
Conversation
…g a page has read - /config.json has build, when the server was built, from pkg/version's BuildDate, so a frontend knows a server was rebuilt with the same version, such as while it's developed - ConfigController treats a server back with another build as upgraded, and says it's been rebuilt - ConfigController takes the config, as config, which the page has read, so it doesn't read /config.json again Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The regression test can pass despite redundant configuration fetches, and the documented Makefile substitution can leave BuildDate empty.
2 open issues
What changed in this PR
This PR lets frontends detect same-version server rebuilds and offer a page refresh. It also lets ConfigController reuse configuration already loaded by the page, avoiding a duplicate initial request.
Changes:
- Expose the server’s build timestamp through
/config.json. - Detect rebuilds and show refresh notifications and status tooltips.
- Accept preloaded configuration, with updated tests and usage documentation.
| File | Description |
|---|---|
| frontend/test/config-controller.test.ts | Add preloaded-configuration and rebuild tests. |
| frontend/src/config/view.ts | Show rebuild-specific refresh tooltips. |
| frontend/src/config/schema.ts | Add the optional build timestamp. |
| frontend/src/config/controller.ts | Reuse preloaded configuration and detect changed builds. |
| frontend/README.md | Document build timestamps and configuration reuse. |
| config/config.go | Include the server build time in configuration responses. |
| config/config_test.go | Cover the build field in handler responses. |
Review effort: Balanced
…DME's build date Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.


Two changes to
config, and to the TypeScript package'sConfigController.Rebuilt servers offer Refresh. The controller only offered Refresh when the version changed. A server rebuilt with the same version, such as while it's developed (
git describedoesn't change until a commit), just said "The server is back"./config.jsonnow hasbuild: when the server was built, frompkg/version.BuildTime()(theBuildDateldflag, which go-server's Makefile already sets).buildisupgraded. The notification andgs-server-status's tooltip then say it's been rebuilt, with Refresh.BuildDatebehave as before. The README says how to set it.A page reads
/config.jsononce. A page reads its config to find the API, then made the controller read it again.ConfigControllernow takesconfig, the config the page has read, and startsupwith it.