Skip to content

fix(config): unfreeze bundled ckb-tui version for upgraded installs - #480

Merged
RetricSu merged 1 commit into
developfrom
agent/claude-bear/19afdb3b
Jul 31, 2026
Merged

fix(config): unfreeze bundled ckb-tui version for upgraded installs#480
RetricSu merged 1 commit into
developfrom
agent/claude-bear/19afdb3b

Conversation

@humble-little-bear

Copy link
Copy Markdown
Collaborator

Problem

Releases up to 0.4.10 wrote the entire merged settings object back to settings.json on any offckb config set (proxy, ckb-version, etc.), freezing the then-current bundled ckb-tui version (v0.1.3) into the user config. After upgrading offckb, that frozen value overrides the new shipped default — and the stale-binary digest check from #476 compares against the configured version, so it never triggers a reinstall either. Result: any user who ever ran config set stays on ckb-tui v0.1.3 forever, even after #476 ships.

Fix

  • readSettings: if the persisted ckb-tui version is older than the shipped default, upgrade it in memory (a newer hand-set version is still respected; unparseable values are left for install-time validation to report).
  • writeSettings: no longer persists the ckb-tui version when it merely equals the default, so future default bumps flow through to existing installs instead of being frozen again.

Tests

  • New tests/setting.test.ts with 9 cases covering: frozen old version upgraded, newer hand-set version respected, unparseable value preserved, default version not written back on config set, and round-trip behavior.
  • Full suite: 31 test suites / 257 tests pass; tsc and eslint clean.
  • Changeset included (patch).

Follow-up to #476 — recommend shipping both in the next release.

Releases up to 0.4.10 wrote the entire merged settings object on any
`offckb config set`, freezing the then-current bundled ckb-tui version
(v0.1.3) into settings.json. After upgrading offckb, the frozen value
overrode the new shipped default, so affected users never moved to
v0.1.4 — and the stale-binary digest check compares against the
configured version, so it never triggered a reinstall for them either.

readSettings now upgrades a persisted ckb-tui version that is older
than the shipped default (a newer hand-set version is still respected,
and unparseable values are left for install-time validation), and
writeSettings no longer persists the version when it merely equals the
default, so future default bumps flow through.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e29d5430-f4f5-48b6-8901-8a08784c1941

📥 Commits

Reviewing files that changed from the base of the PR and between 178379f and b44eb2a.

📒 Files selected for processing (3)
  • .changeset/ckb-tui-frozen-version-migration.md
  • src/cfg/setting.ts
  • tests/setting.test.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Upgraded installations now correctly use the latest bundled ckb-tui version.
    • Older bundled versions saved in configuration are automatically updated.
    • Newer manually configured versions remain unchanged.
    • Default bundled versions are no longer unnecessarily saved to configuration, preventing future upgrades from being blocked.

Walkthrough

Settings now migrate older persisted bundled ckb-tui versions to the shipped default during reads and avoid persisting that version when it already matches the default. Tests cover version comparison, logging, preservation, cloning, and round-trip behavior.

Changes

Settings version migration

Layer / File(s) Summary
Read-time version normalization
src/cfg/setting.ts, tests/setting.test.ts
readSettings upgrades older strict ckb-tui versions while preserving newer, equal, and unparseable values; tests verify settings preservation and logging.
Write-time version persistence
src/cfg/setting.ts, tests/setting.test.ts, .changeset/ckb-tui-frozen-version-migration.md
writeSettings clones input settings and omits versions matching the shipped default while retaining differing versions; the changeset documents the migration.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: preventing bundled ckb-tui from being frozen in upgraded installs.
Description check ✅ Passed The description directly explains the bug, fix, and tests, and matches the changeset well.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@RetricSu
RetricSu merged commit e232028 into develop Jul 31, 2026
7 checks passed
@RetricSu
RetricSu deleted the agent/claude-bear/19afdb3b branch July 31, 2026 02:29
RetricSu added a commit that referenced this pull request Jul 31, 2026
Merge pull request #480 from ckb-devrel/agent/claude-bear/19afdb3b
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.

2 participants