Repository navigation
Tell open pages and the extension when a new version is out - #2
Merged
Merged
Conversation
The web app writes its build id into index.html and version.json. The page compares the two when it is shown again and every 30 minutes, and shows a notice with a Reload button. It never reloads by itself: Reload pauses playback and saves the reading position first, and waits while a voice is downloading. The service worker never caches version.json, and the voices stay in the Origin Private File System, which updates do not touch. The extension popup asks GitHub for the latest release at most once a day and, when it is newer, says how to update the unpacked folder. A release workflow attaches narrata-extension-<version>.zip to v* tags.
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 app and the extension now tell people when a new version is out, and updating takes one click.
Web app
index.htmlandversion.json. The page checksversion.jsonwhen it becomes visible again (at most once a minute), every 30 minutes, and when the browser finds a new service worker. The service worker never cachesversion.json, and the fetch adds a query and usesno-store, so themax-age=600that GitHub Pages sends cannot hide a deploy.register.tsis unchanged.Extension
api.github.comfor the latest release at most once a day (cached inchrome.storage). When that release is newer than the manifest version, it shows "Update available: vX", the steps, and a button to the release page. There are still no host permissions;connect-srconly gainshttps://api.github.com.v*tag it checks that the tag matchespackage.json, builds the extension and attachesnarrata-extension-<version>.zipto the release.package.jsonstays the only place the version is set.version.json.There is no release yet, so the README's zip link has nothing to point to until a
v0.1.0tag is pushed after this is merged.Tests
version.jsoncheck, and for the extension's version compare, release parsing and daily cache.tests/e2e/verify-update.mjsbuilds A, serves it under/narrata/without isolation headers, waits for isolation, starts reading the sample, then builds B into the same folder during playback. The notice appears, nothing reloads while audio plays, and Reload gives B, still isolated, on the same document and position, with the voice files unchanged. Passed locally.tests/e2e/verify-ext-update.mjsloads the extension unpacked with GitHub stubbed: a notice for a newer release, none when up to date, one request a day. Passed locally.