Skip to content

[DRAFT] Add SERP install-origin bridge messaging handlers#9175

Draft
catalinradoiu wants to merge 2 commits into
developfrom
feature/cradoiu/serp-bridge-install-origin
Draft

[DRAFT] Add SERP install-origin bridge messaging handlers#9175
catalinradoiu wants to merge 2 commits into
developfrom
feature/cradoiu/serp-bridge-install-origin

Conversation

@catalinradoiu

@catalinradoiu catalinradoiu commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1211724162604201/task/1215859134164547?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/481882893211075/task/1216231494506797?focus=true

Description

Implements the new SERP install-origin bridge on Android: a handshake message that advertises whether the bridge is available, and a getInstallOriginVariant message that returns the install-origin variant for a given campaign (or null). Both are implemented as ContentScopeJsMessageHandlersPlugins in referral-impl, gated behind the new installOriginBridge feature flag (default off, internal-enabled).

InstallOriginVariantResolver parses the stored utmOriginAttributeCampaign value and only returns the content segment when the entry is home, the campaign matches the request, and the app was installed within the last 28 days — otherwise it returns null.

Also updates ContentScopeScriptsJsMessaging so that once a message is handled via the addDebugFlag callback path, it no longer falls through to the plugin-handler lookup.

Steps to test this PR

SERP handshake / getInstallOriginVariant

  • Enable the installOriginBridge feature flag (internal build) and set an install origin containing a home entry and known campaign (e.g. via debug override or a fresh install with the referrer set)
  • Open the SERP and confirm the handshake message responds with installOrigin: true
  • Call getInstallOriginVariant with the matching campaign and confirm the content segment is returned
  • Call with a non-matching campaign, wrong entry segment, or after 28 days since install and confirm variant: null is returned
  • Disable the feature flag and confirm handshake responds with installOrigin: false

UI changes

No UI changes | No UI changes

Implements the handshake and getInstallOriginVariant messages for the
new SERP bridge (ContentScopeJsMessageHandlersPlugin), gated behind the
installOriginBridge feature flag. Also ensures the dispatcher does not
fall through to the plugin lookup once addDebugFlag has been handled.

Task: https://app.asana.com/1/137249556945/project/1211724162604201/task/1215859134164547?focus=true

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@catalinradoiu catalinradoiu changed the title Add SERP install-origin bridge messaging handlers [DRAFT] Add SERP install-origin bridge messaging handlers Jul 14, 2026
When no plugin handler matches an incoming message, respond with a
{"code":-32601,"message":"Method not found"} error instead of silently
dropping it (skipped when the message has no id to correlate a reply
to). This required widening JsRequestResponse.Error.error from a plain
String to a structured JsErrorDetails(code, message) in js-messaging-api,
since it previously had no way to express a JSON-RPC-style error object.

Task: https://app.asana.com/1/137249556945/project/1211724162604201/task/1215859134164547?focus=true
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.

1 participant