Repository navigation
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Production handling of unknown Android binary hashes remains unverified, including update-check acceptance and full-update selection, which is essential because Android cannot apply diffs against the embedded binary.
No open issues 🎉
What changed in this PR
This PR makes Android report the binary package hash during update checks when no CodePush update is installed, matching iOS behavior and supporting server-side hash validation for future store-release delta updates.
Changes:
- Extracts query-package selection into a React Native–independent TypeScript helper.
- Adds unit tests for binary hashes, missing hashes, and installed-package precedence.
- Integrates the helper into
checkForUpdate, removes the unusedPlatformimport, and updates the related comment.
| File | Description |
|---|---|
src/build-query-package.ts |
Selects the installed package or binary version and available hash. |
src/__tests__/build-query-package.test.ts |
Tests the helper’s three main selection cases. |
CodePush.js |
Uses the helper to include Android binary hashes and updates imports and commentary. |
Review effort: Balanced
ofalvai
marked this pull request as draft
November 5, 2026 12:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When no CodePush update is installed,
checkForUpdatenow sends the binary's package hash on Android as it already does on iOS. The query-package decision moved fromCodePush.jsinto a small TS function,buildQueryPackageinsrc/, so it can be unit tested without react-native. The now-stale case 4 comment incheckForUpdateis reworded, and the unusedPlatformimport is removed.Why
The server can then log which hashes Android devices report, to check that they match hashes extracted from store builds (part of the delta-updates-for-store-releases design). Shipping this early gives that data before anything depends on it.
Android already computes the hash natively, so there is no new native cost. It is still null in debug builds, so nothing is sent there. If the server answers with the binary's own hash, the existing check in
checkForUpdateignores it. The Android binary-patch path inCodePushUpdateManagerstill refuses, and the server has no store-build patch bases yet, so it can't be reached.Verification
npm run lint,npm run typecheck,npm run build:tsandnpm run test:unit:js(26 passing, including 3 newbuildQueryPackagetests) all pass.Unverified
package_hashchange when Android starts sending it.🤖 Generated with Claude Code