🐛 Fix Shopify Custom Pixel actions being marked as background events, flatten ui_extension_errored context - #4946
Open
lierniel wants to merge 3 commits into
Conversation
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: d28d7cf | Docs | Datadog PR Page | Give us feedback! |
lierniel
marked this pull request as ready for review
August 13, 2026 15:45
BenoitZugmeyer
approved these changes
Aug 13, 2026
| type: error?.type, | ||
| appName: error?.appName, | ||
| }, | ||
| extensionName: error?.extensionName, |
Member
There was a problem hiding this comment.
nitpick: usually we use snake_case for attributes
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.
Motivation
RUM-18056
Two related fixes to the Shopify Custom Pixel integration:
startAction/stopActionin the Custom Pixel sandbox were always being reported withview.in_foreground: false. The pixel runs in a sandboxed iframe with no focusable UI, sodocument.hasFocus()always returnsfalsethere, whichpageStateHistory.tsinterprets as the page being backgrounded — even when the customer is actively on the checkout page.ui_extension_errorederror context nested anextension: { name, target, type, appName }object whosetypefield read as the same concept as the SDK's own error-name-derivedtype, but is actually an unrelated ShopifyUiExtensionErrorTypeenum (e.g.EXTENSION_USAGE_ERROR).Changes
patchSandboxedIframeApis.ts: shimsdocument.hasFocus()to always returntrueinside the Custom Pixel sandbox, alongside the existingcookieStore/navigator.locks/contentWindowshims for that same sandboxed context.shopifyBindings.ts: flattens theui_extension_erroredcontext and renamestypetoextensionErrorTypeto disambiguate it from the SDK's own error type. Also forwardsappIdandappVersion, which Shopify includes on the error payload but weren't previously captured.shopifyBindings.spec.tsfor the new flattened shape.Test instructions
yarn test:unit --spec packages/browser-rum-shopify/src/domain/shopifyBindings.spec.tspassesChecklist