feat: tell the operator when a newer release exists - #174
Open
faithfulojebiyi wants to merge 1 commit into
Open
Conversation
There is no update mechanism at all today, so anyone who installed a broken build has no way to learn a fix shipped — v0.3.0 shows "damaged" and v0.3.1 has a dead microphone, and both are dead ends for whoever downloaded them. This is a notice, not an updater: it never downloads or installs anything. A toast once per launch when a newer release is published, and a row in Settings > Diagnostics beside the version with Download and "Check again". A toast rather than a persistent banner because this app is on screen during live services, and an optional download must not compete with the verse being broadcast. The check runs in Rust rather than the webview. The app's CSP is `connect-src 'self'`, and a version string is not worth widening it for. Failures resolve to null and render nothing — being offline is ordinary in a lot of church buildings, not an incident worth a dialog. Version comparison is numeric per component with zero-padding for ragged counts, and anything unparseable — prerelease tags, "nightly", garbage — reports "not newer" so a version we cannot reason about never nags anyone to install it. /releases/latest already excludes prereleases and drafts, so only complete public releases are ever reported. Also registers tauri-plugin-opener on the Rust side. The JS package was already a dependency but the plugin was never initialised and had no capability entry, so opening a URL would have failed. Its permission is scoped to https://github.com/openbezal/rhema/* rather than allowing arbitrary URLs. Fixes the typecheck script while here: `tsc --noEmit` against a solution tsconfig with `files: []` checked zero files and had been silently passing. Build mode follows the project references, and it immediately caught a real narrowing error in this change.
Collaborator
|
Screenshot? |
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.
Option A from the update discussion: a notice, not an updater. It never downloads or installs anything.
Today there is no update mechanism at all, so anyone who installed a broken build is stranded — v0.3.0 shows "damaged", v0.3.1 has a dead microphone, and neither will ever tell its user that v0.3.2 fixed it.
What it does
Design notes
connect-src 'self'; a version string isn't worth widening it for.fetchUpdateStatusresolves tonull— being offline is ordinary in a church building, not an incident worth a dialog.nightly, garbage → "not newer", so a version we can't reason about can't nag anyone./releases/latestalready excludes prereleases and drafts.tauri-plugin-openerwas dead weight: the JS package was a dependency but the Rust plugin was never initialised and had no capability entry, so opening a URL would have failed. Now registered, with its permission scoped tohttps://github.com/openbezal/rhema/*rather than arbitrary URLs.Verification
Unit tests, then mutation-tested to prove they aren't decorative. I wrote tests and implementation in one pass rather than test-first, so instead of claiming the discipline I checked the guarantee it's meant to provide — three deliberate mutations, each caught:
is_neweralways returns falsel < c)vprefix no longer strippedGreen again after restoring. 8 Rust tests cover patch/minor/major,
vprefix, ragged component counts, double-digit components (0.10.0 > 0.9.0), unparseable input, and payload parsing with unknown fields. 2 frontend tests cover the silent-failure contract.End-to-end in a real signed bundle, both paths, read from the log rather than assumed:
The second was forced by temporarily lowering the bundle version, and I screenshotted the running app to confirm the toast actually renders: "Rhema 0.3.2 is available / You are running 0.3.0." with a Download button. The temporary version change is reverted;
git diffontauri.conf.jsonis empty.Regression checks against the v0.3.2 fixes (since signing/entitlements were the last two regressions):
disable-library-validation✓,device.audio-input✓Suite: 222 frontend tests, 23 Rust tests,
cargo clippyclean on the new file, and zero new lint problems (145 with and without the change, viastash -u).Two process problems this surfaced
bun run typecheckwas a no-op.tsc --noEmitagainst a solutiontsconfig.jsonwith"files": []checks zero project files —--listFilesconfirms. It passed while this branch had a real type error, which onlybun run build'stsc -bcaught. Changed totsc -b --noEmitand verified by injecting a deliberate error and watching it fail.Not included (deliberately)
Auto-install, "skip this version" persistence, update channels. Full auto-update (
tauri-plugin-updater) is worth doing once there's an Apple Developer ID — with ad-hoc signing, every auto-update would likely re-prompt for microphone permission, since macOS ties TCC decisions to signing identity.