Skip to content
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(iOS): Solana error after broadcast on WebSockets [LIVE-14585] #8169

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

Justkant
Copy link
Contributor

@Justkant Justkant commented Oct 22, 2024

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests. Tested manually as it requires to broadcast the transaction
  • Impact of the changes:
    • iOS websocket usage (Solana/send)

📝 Description

Our proxy for Solana is blocking the connection when no user-agent is provided
We are adding the missing user-agent header on the websocket for iOS with RN
We need to use the interceptor as we don't control the code initiating the websocket
Updating the options passed in by the interceptor works fine
Another solution could be to use pnpm to patch react native WebSocket
But the interceptor seems lean enough and a simple hack vs patching a lib seems preferable

Related issues:

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

We are adding a missing user-agent header on the websocket for iOS with RN
facebook/react-native#28450
facebook/react-native#30727
We need to use the interceptor as we don't control the code initiating the websocket
Updating the options passed in by the interceptor works fine
https://github.com/facebook/react-native/blob/3dfe22bd27429a43b4648c597b71f7965f31ca65/packages/react-native/Libraries/WebSocket/WebSocketInterceptor.js#L148-L163
Another solution could be to use pnpm to patch react native WebSocket linked below
https://github.com/facebook/react-native/blob/3dfe22bd27429a43b4648c597b71f7965f31ca65/packages/react-native/Libraries/WebSocket/WebSocket.js
But the interceptor seems lean enough and a simple hack vs patching a lib seems preferable
@Justkant Justkant self-assigned this Oct 22, 2024
@Justkant Justkant requested a review from a team as a code owner October 22, 2024 13:31
Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Oct 22, 2024 1:35pm
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Oct 22, 2024 1:35pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 22, 2024 1:35pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 22, 2024 1:35pm
web-tools ⬜️ Ignored (Inspect) Visit Preview Oct 22, 2024 1:35pm

@live-github-bot live-github-bot bot added the mobile Has changes in LLM label Oct 22, 2024
@Justkant Justkant merged commit c4f102d into develop Oct 22, 2024
43 of 46 checks passed
@Justkant Justkant deleted the bugfix/LIVE-14585 branch October 22, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants