Desktop: add an opt-in path to fetch updates through the…#354
Merged
Conversation
… (#2225)
* feat(open-knowledge): desktop update-feed proxy cutover (default-off)
Point electron-updater's feed at openknowledge.ai/updates/{channel} so updates
can be counted per version, gated default-off.
- UpdaterLike gains requestHeaders and a widened setFeedURL (generic + github
provider options). When the build's channel is enabled, the feed is set to the
generic proxy and requests carry x-ok-from-version + x-ok-channel headers.
- Activation is the channel set passed from index.ts, currently empty, so
production keeps reading the GitHub publish config until the proxy is verified
live. Flip to beta first, then latest.
- A dev OK_UPDATER_FEED_URL override still takes precedence. On a first-check
feed failure the session reverts to the GitHub provider, so reliability never
drops below GitHub-direct.
- Tests cover channel mapping, default-off, dev precedence, and the fallback.
Not activated and not shipped: the proxy stays off until the channel set is
flipped at build time.
* fix(open-knowledge): revert to GitHub feed on updater error event
electron-updater surfaces feed/manifest failures primarily through the
error event, not as a checkForUpdates() rejection. The proxy-feed
fallback was only wired to the first-check rejection path, so a proxy
error on the common path left the session stuck on the broken proxy.
Call revertToGithubFeed from onError (idempotency guard keeps it a no-op
once the fallback has run or when the proxy is off), wrap the fallback
setFeedURL in try/catch so a throw inside an async catch cannot escape as
an unhandled rejection, and log the post-fallback re-check failure at the
classified/unclassified level instead of always debug.
Adds a test that emits an error event (not a rejection) with the proxy
feed active and asserts the GitHub provider fallback fires.
* test(open-knowledge): harden updater proxy-fallback coverage
Address the three non-blocking test-coverage notes from review:
- assert the periodic timer is armed in the proxy first-check fallback
test, so a dropped startPeriodicChecks() on that path can't pass silently
- add an idempotency-guard test: a second error event after fallback does
not call setFeedURL again
- add a try/catch-branch test: a throw from the GitHub fallback setFeedURL
is caught and the load-bearing return prevents a re-check
GitOrigin-RevId: cd50493da89bbd919293ddc26dc4fcb335fc69a2
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28304632164). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
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.
Desktop: add an opt-in path to fetch updates through the openknowledge.ai proxy so updates can be counted per version. When the build's channel is enabled, electron-updater's feed is pointed at
openknowledge.ai/updates/{channel}and requests are tagged withx-ok-from-version/x-ok-channelheaders. Default-off — production keeps reading the GitHubpublish:config until the proxy is verified live, then the enabled-channel set flips to beta-first. A feed failure on the first check reverts to the GitHub provider for the session, so auto-update reliability never drops below GitHub-direct.