Repository navigation
fix(js): resolve gray rollouts in client.checkUpdate and switch to the downloaded version - #667
Conversation
…e downloaded version - client.checkUpdate now returns the result resolved for this device (gray rollout bucket, running version), as the provider already presented it. Before, only the provider resolved it: a direct client.checkUpdate() -> downloadUpdate() ignored the rollout percentage and installed the root release, and afterCheckUpdate saw the unresolved response. The provider no longer resolves a second time. - useUpdate().switchVersion() / switchVersionLater() without an argument target the downloaded version (the only one the client accepts), falling back to the last checked info only before any download. A check that found a newer release after the download used to turn "switch now" into a silent no-op. The provider reads it through client.getDownloadedHash() instead of the client module's sharedState. - The unknown-bundle warning names the brand's own CLI (cresc for Cresc). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Bump package.json and harmony/pushy/oh-package.json5 together, with the bilingual release notes. Ships everything since 10.60.0: the shared native round engine (#673-#681), the cross-platform alignment and fixes (#664, #666, #671, #687, #688), the JS client fixes and split (#667, #684, #685), the bounded host prepareBundle (#669), the generated cross-platform contract (#683, #686) and the trimmed npm package (#670). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
架构审查里 JS 层的两个用户可见缺陷,外加一处品牌文案。
修了什么
client.checkUpdate返回按本设备解析后的结果。 解析依据是本设备的灰度分桶和正在运行的版本,provider 原本就是这样呈现的。以前只有 provider 做这一步,所以直接调用client.checkUpdate()再downloadUpdate()的用户会无视灰度比例、装上根版本;afterCheckUpdate收到的也是未解析的原始响应。provider 不再重复解析。useUpdate().switchVersion()与switchVersionLater()不带参数时,切到已下载的版本。 client 只接受已下载的版本;只有在还没下载过任何版本时,才退回用最近一次检查到的版本。以前的场景是:下载完 A 之后,又一次检查发现了更新的 B,updateInfo 变成 B,这时「立即更新」就成了没有任何提示的空操作。provider 现在通过client.getDownloadedHash()读取已下载版本,不再直接读 client 模块的sharedState。cresc uploadIpa等,不再是pushy。行为变化
直接调用
client.checkUpdate()的返回值不再带expVersion字段。灰度命中时,返回的就是灰度版本本身。通过 provider 或useUpdate()使用的应用不受影响。验证
bun lint通过,bun test437 个用例全部通过。expVersion。switchVersionLater(),切换目标是 A。🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit