[codex] fix client rollout current-hash updates#580
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR refactors update result resolution by extracting rollout and version-comparison logic into a new ChangesUpdate Resolution and Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
What changed
resolveCheckResultstep for choosing the effective update candidate from the server response.expVersionover the root response, so rollout candidates no longer inherit rootdiff,pdiff,full, or unrelated update fields.currentVersionasupToDate, and stop before falling through to the root full-release candidate.downloadUpdateguard that skips downloads when the requested update hash equals the current hash.Why
The server currently returns a candidate set: a root full-release candidate plus an optional rollout candidate.
react-native-update@10.37.5and current master mergedexpVersionwith the root response. When a rollout device had already installed the rollout hash, the rollout candidate could inheritupdate: trueand root artifacts, causing the client to attempt downloading the same version or mismatched artifacts.Keeping the decision client-side preserves the existing server protocol and cache behavior while making the client resolve the effective candidate correctly.
Validation
bun test src/__tests__bun run lintSummary by CodeRabbit
Bug Fixes
Tests