[FEAT-2] SDK: client diff support + native applier scaffold (flag-gated)#1
Open
prasad-rently wants to merge 8 commits into
Open
[FEAT-2] SDK: client diff support + native applier scaffold (flag-gated)#1prasad-rently wants to merge 8 commits into
prasad-rently wants to merge 8 commits into
Conversation
Appends `client_capabilities` to update_check requests via our own request-fetch-adapter.js (no change to the upstream code-push acquisition SDK). Capability list is EMPTY by default → classic behavior unchanged until a feature's client side ships. Pure logic, 6 node assertions green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Upstream code-push@4.2.2 queryUpdateWithCurrentPackage drops unknown response fields. patch-package patch forwards is_diff/diff_url/source_hash (FEAT-2) and asset_manifest_url (FEAT-1) into remotePackage so they reach CodePush.js + native. Classic responses unaffected (fields are undefined when not sent). Interim stopgap — scoped acquisition rewrite tracked as PENDING (ROADMAP §1b). Patch validated: applies clean + node --check OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…s (scaffold) - T3.1 diff-support.js shouldAttemptDiff() opt-in gate (6 assertions green). Diff fields already flow to native via package-mixins + SDK-C1 patch. - T3.2/T3.3 CodePushDiffPatcher (Android jbsdiff / iOS bspatch wrapper) — ADDITIVE, NOT wired into the working download path; classic flow untouched.⚠️ Native is UNVERIFIED (no NDK/Xcode/device here) — see FEAT-2-NATIVE-INTEGRATION.md for the integration + device verification steps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The scaffolds referenced an unadded gradle dep (jbsdiff) and an unvendored C symbol (codepush_bspatch) — those would break the Android/iOS builds since the source globs compile them. Convert to compile-clean placeholders: applyPatch throws (Android) / returns nil (iOS) so callers fall back to a full download; real impl + wiring documented inline and in FEAT-2-NATIVE-INTEGRATION.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
FEAT-2 pending follow-ups (tracked)Critical path to diffs working on a device:
Server-side (paired PR rently-com/react-native-ota-updater#29): issues microsoft#30 (Redis lock), microsoft#31 (Postgres/R2 CI). |
Single common document describing the full FEAT-2 flow across server + client as one story. Identical copy in both repos. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d path When update_check offers a diff (diffUrl/sourceHash/bundleHash), downloadPackage now tries to reconstruct the new bundle by applying a bsdiff patch to the current bundle, instead of a full download: - verify current bundle hash == sourceHash, download patch, apply (jbsdiff), - copy current package (assets) into the new folder + replace the bundle, - verify reconstructed hash == bundleHash, write metadata. ANY failure ⇒ falls through to the normal full HTTP download (classic path intact). CodePushDiffPatcher: real jbsdiff apply + sha256 (replaces placeholder). + io.sigpipe:jbsdiff dependency. NOTE: device-validation pending (cannot build Android into an app here). Built on the apply core already validated on iOS simulator + jbsdiff format-verified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirrors the Android hook. When update_check offers a diff, CodePushPackage downloadPackage tries to reconstruct the new bundle via bspatch instead of a full download: verify current bundle == sourceHash, download patch, copy current package (assets) + replace bundle via vendored ota_bspatch, verify == bundleHash, write metadata. ANY failure ⇒ falls through to the normal download (classic intact). - Vendored public-domain bspatch core (bsdiff/ota_bspatch.c) — recompiled + re-validated (exact target hash). - CodePushDiffPatcher: real applyPatch + sha256 (CommonCrypto). - Podspec: include subdir + .c; link libbz2. NOTE: device-validation pending (cannot build iOS into an app here). Core proven on iOS simulator earlier. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
FEAT-2 — Differential JS Bundle Updates (client/SDK side)
Pairs with the server PR (rently-com/react-native-ota-updater#29). Off by default → classic CodePush behavior unchanged (capability list is empty; native applier not wired in).
✅ Verified in this PR
client-capabilities.js— advertisesclient_capabilitieson update_check (empty by default). 6 node assertions.patches/code-push+4.2.2.patch— the upstreamcode-push@4.2.2acquisition SDK drops unknown response fields; this forwardsis_diff/diff_url/source_hash(FEAT-2) andasset_manifest_url(FEAT-1) intoremotePackage. Validated: applies clean +node --checkOK.diff-support.jsshouldAttemptDiff()— opt-in client gate (experimental.bundleDiff). 6 node assertions.android/.../CodePushDiffPatcher.java(jbsdiff) andios/CodePush/CodePushDiffPatcher.{h,m}(bspatch wrapper).FEAT-2-NATIVE-INTEGRATION.md.Tracked debt
Reviewer note
Do not add
"bundle-diff"toCLIENT_CAPABILITIESuntil the native applier is integrated and verified on both platforms — until then the server never offers diffs and everything stays classic.🤖 Generated with Claude Code