Skip to content

fix(server): use BUNDLED_VERSION for app version in binary mode#1049

Merged
Wirasm merged 2 commits into
devfrom
fix/binary-version-check
Apr 10, 2026
Merged

fix(server): use BUNDLED_VERSION for app version in binary mode#1049
Wirasm merged 2 commits into
devfrom
fix/binary-version-check

Conversation

@Wirasm

@Wirasm Wirasm commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Problem: appVersion in the API routes reads package.json via import.meta.dir, which is baked to the CI runner path in compiled binaries — always resolves to unknown
  • Why it matters: the update check compares unknown against the latest release and always shows an update badge, even when the binary is current
  • What changed: use BUNDLED_VERSION (build-time constant) in binary mode, fall back to package.json in dev

Files Changed

1 file: packages/server/src/routes/api.ts

Testing

  • Type check passes
  • The stale ~/.archon/update-check.json cache (pointing at v0.3.2) should also be cleared by users or will expire after 24h

Summary by CodeRabbit

  • Improvements
    • Release update checks now run hourly instead of daily, ensuring you stay informed about new versions more promptly.
    • Binary builds now initialize faster with optimized version detection, eliminating unnecessary file system operations during startup.

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1b0c803-17ef-4b37-88f2-79560059c21c

📥 Commits

Reviewing files that changed from the base of the PR and between 9da44d3 and 21cceb3.

📒 Files selected for processing (2)
  • packages/paths/src/update-check.ts
  • packages/server/src/routes/api.ts

📝 Walkthrough

Walkthrough

The PR reduces the update-check cache staleness window from 24 hours to 1 hour and adds conditional version resolution logic based on build type. Binary builds use a bundled version constant; non-binary builds read from package.json with debug logging on failure.

Changes

Cohort / File(s) Summary
Update Check Cache Configuration
packages/paths/src/update-check.ts
Reduced cache staleness timeout from 24 hours to 1 hour, causing cached GitHub release data to be treated as stale more quickly.
Server Version Resolution
packages/server/src/routes/api.ts
Added conditional version resolution logic: binary builds use BUNDLED_VERSION import; non-binary builds read package.json with error handling and debug logging. Eliminates filesystem access during initialization for binary builds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Hop, hop! The cache now checks more spry,
Version bundled swift—no files to pry!
Binary builds now fetch from constants' nest,
While standard builds read files, freshness blessed! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the problem, impact, and solution clearly but is missing several required template sections including Architecture Diagram, Label Snapshot, Change Metadata, Validation Evidence, Security Impact, and other compliance sections. Complete the remaining required sections from the template: add Architecture Diagram, Label Snapshot with risk/size/scope/module labels, Change Metadata, full Validation Evidence (command outputs), Security Impact assessment, Compatibility notes, Human Verification details, Side Effects analysis, and Rollback Plan.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: using BUNDLED_VERSION for app version in binary mode, which is the primary fix addressing the appVersion resolution issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/binary-version-check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Wirasm Wirasm merged commit 6048938 into dev Apr 10, 2026
4 checks passed
Tyone88 pushed a commit to Tyone88/Archon that referenced this pull request Apr 16, 2026
fix(server): use BUNDLED_VERSION for app version in binary mode
joaobmonteiro pushed a commit to joaobmonteiro/Archon that referenced this pull request Apr 26, 2026
fix(server): use BUNDLED_VERSION for app version in binary mode
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