Skip to content

Desktop: add an opt-in path to fetch updates through the…#354

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jun 27, 2026
Merged

Desktop: add an opt-in path to fetch updates through the…#354
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

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 with x-ok-from-version / x-ok-channel headers. Default-off — production keeps reading the GitHub publish: 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.

… (#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

@inkeep-internal-ci inkeep-internal-ci Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@inkeep-oss-sync inkeep-oss-sync Bot merged commit bb347d1 into main Jun 27, 2026
1 check passed
@inkeep-oss-sync inkeep-oss-sync Bot deleted the copybara/sync branch June 27, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant