-
Notifications
You must be signed in to change notification settings - Fork 31
fix(rn-window): handle frame-ready plain string in handleMessage #1521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(rn-window): handle frame-ready plain string in handleMessage #1521
Conversation
The handleMessage() method was failing when receiving the 'frame-ready' message from the open-signer frame because it attempted to parse all messages as JSON. EventsService.notifyReady() sends 'frame-ready' as a plain string, not JSON. This fix checks for the 'frame-ready' string before attempting JSON parsing, preventing the JSON parse error while still correctly handling all other JSON messages. Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
Original prompt from Alberto EliasTesting:
You only need to look in the following repo: Crossmint/crossmint-sdk |
🦋 Changeset detectedLatest commit: 8fe02c4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
Description
Fixes a JSON parse error in React Native WebView transport when receiving the "frame-ready" message from the open-signer frame.
Root cause:
EventsService.notifyReady()sends "frame-ready" as a plain string, butRNWebViewTransport.handleMessage()was attempting to parse all incoming messages as JSON.Solution: Check for the "frame-ready" string before attempting JSON parsing and return early since this message doesn't need to be dispatched to listeners.
Test plan
Human review checklist
Package updates
@crossmint/client-sdk-rn-window: patch (changeset added)Link to Devin run: https://app.devin.ai/sessions/884e19777e1d4fa89a507ff8471ed740
Requested by: Alberto Elias (alberto.elias@paella.dev) (@albertoelias-crossmint)