[DRAFT] Add SERP install-origin bridge messaging handlers#9175
Draft
catalinradoiu wants to merge 2 commits into
Draft
[DRAFT] Add SERP install-origin bridge messaging handlers#9175catalinradoiu wants to merge 2 commits into
catalinradoiu wants to merge 2 commits into
Conversation
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
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
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.

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
handshakemessage that advertises whether the bridge is available, and agetInstallOriginVariantmessage that returns the install-origin variant for a given campaign (ornull). Both are implemented asContentScopeJsMessageHandlersPlugins inreferral-impl, gated behind the newinstallOriginBridgefeature flag (default off, internal-enabled).InstallOriginVariantResolverparses the storedutmOriginAttributeCampaignvalue and only returns thecontentsegment when the entry ishome, the campaign matches the request, and the app was installed within the last 28 days — otherwise it returnsnull.Also updates
ContentScopeScriptsJsMessagingso that once a message is handled via theaddDebugFlagcallback path, it no longer falls through to the plugin-handler lookup.Steps to test this PR
SERP handshake / getInstallOriginVariant
installOriginBridgefeature flag (internal build) and set an install origin containing ahomeentry and known campaign (e.g. via debug override or a fresh install with the referrer set)handshakemessage responds withinstallOrigin: truegetInstallOriginVariantwith the matching campaign and confirm thecontentsegment is returnedvariant: nullis returnedhandshakeresponds withinstallOrigin: falseUI changes
No UI changes | No UI changes