Skip to content

chore(webview): document and pin the Discover bridge v3 contract [PERA-4672] - #1090

Draft
yasin-ce wants to merge 1 commit into
mainfrom
yasince/chore/PERA-4672
Draft

chore(webview): document and pin the Discover bridge v3 contract [PERA-4672]#1090
yasin-ce wants to merge 1 commit into
mainfrom
yasince/chore/PERA-4672

Conversation

@yasin-ce

Copy link
Copy Markdown
Collaborator

Description

  • Turns the RN <-> web bridge method set into a single enforced source of truth. bridge-methods.ts holds the v3 list plus an isSupportedBridgeMethod guard; usePeraWebviewInterface now rejects anything outside it instead of falling through a switch default.
  • Records the contract in docs/DISCOVER_BRIDGE_CONTRACT.md, with a contract test that fails if the list and the dispatch drift apart.
  • Adds a webview_bridge_method_not_found analytics event so a page calling outside the contract is visible rather than silently ignored.

Related Issues

Checklist

  • Have you tested your changes locally?
  • Have you reviewed the code for any potential issues?
  • Have you documented any necessary changes in the project's documentation?
  • Have you added any necessary tests for your changes?
  • Have you updated any relevant dependencies?

Additional Notes

The telemetry is here rather than in a follow-up because the guard needs somewhere to report to — a method that fails closed silently is indistinguishable from a broken bridge when a partner page misbehaves.

The contract test is the part worth keeping honest: it asserts the documented list and the dispatch agree, so adding a method without updating the doc fails CI rather than quietly widening the surface.

@yasin-ce
yasin-ce force-pushed the yasince/chore/PERA-4672 branch from 5a8e181 to 4da8de7 Compare July 30, 2026 13:21
@filipetamota

Copy link
Copy Markdown
Collaborator

@yasin-ce QA and code review done ✅

@yasin-ce
yasin-ce force-pushed the yasince/chore/PERA-4672 branch from 4da8de7 to ec75b00 Compare July 31, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants