Repository navigation
fix(presentation): give each preload a fresh request id (MOB-652) - #322
Open
kherembourg wants to merge 3 commits into
Open
kherembourg wants to merge 3 commits into
kherembourg wants to merge 3 commits into
Conversation
Each preload() call now assigns a new request id. An old view unmount or an old dismiss cannot delete the native entry of a newer preload. PLYPresentationView keeps the request id it mounted with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When no preloaded entry exists and there is no placement or screen, build nothing and log a warning. An empty builder loads ply_default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kherembourg
marked this pull request as ready for review
October 13, 2026 19:29
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Author
|
@greptile review |
Contributor
|
A new React key must adopt the id of the latest preload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptile review |
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
PLYPresentationRequest.preload()gives a freshrequestIdon each call.display()keeps the current id, andclose()/back()target the latest id.PLYPresentationViewkeeps therequestIdit was mounted with,nullincluded. A new request object, or a newpreload()of the same request, needs a remount of the view (a new Reactkey).ply_default). iOS already shows nothing in this case.CHANGELOG.md(Unreleased: Changed + Fixed) andsdk_public_doc.mddescribe the newrequestIdrule.Why
MOB-652. A client (Bayard, RN 6.2.0) saw its inline banner show the full-screen default paywall on Android. One JS request kept one
requestIdfor its whole life, and the native maps used that id as key. An old view unmount, or an old dismiss, deleted the entry of a newerpreload()of the same request. The next mount found nothing and the Android bridge loadedply_default. Production traces on 2026-10-13: a correct placement fetch at 15:33:13 UTC, thenGET presentations/ply_defaultat 15:33:18 UTC, with no CLOSED event.How to verify
cd packages/purchasely && yarn jest src/__tests__/presentation.integration.test.ts src/__tests__/PLYPresentationView.test.tsx -t "MOB-652": 8 passed (head bd25ea9). On the base, 5 of the MOB-652 tests fail because of the shared or re-read id; the others are regression guards. The remount test fails on a variant that caches the id per request object.yarn typecheck: clean.npx eslinton the changed source files: no error.preload()a placement, mount<PLYPresentationView request={request} />, unmount,preload()the same request again, mount a new view: the placement screen shows, never the default screen.Notes
request.requestIdchanges after eachpreload(). A mounted view does not follow it; remount the view to show a new preload.preload()that is never mounted, displayed or dismissed keeps its native entry for the life of the process. The native lookups by screen id (clientPresentationDisplayed/Closed, iOSpresentationprop) can match an older unused preload of the same screen. This ambiguity already exists today between two request objects of the same screen.prettier --checkon the base (for example, 136 of 172 lines ofPLYPresentationView.tsx, 2-space indentation againsttabWidth: 4). The new lines follow the surrounding code. ESLint hasprettier/prettieroff.gpt-6-astrahigh (two rounds); final review by a fresh Claude Opus high reviewer on head a8048b8, findings F1 (stale comment) and F2 (subject length) fixed and verified.🤖 Generated with Claude Code
Greptile
Requested: public SDK contract change,
PLYPresentationRequest.requestIdnow changes on eachpreload()(packages/purchasely/src/presentation.ts, PLYPresentationView.tsx)