sentry icon indicating copy to clipboard operation
sentry copied to clipboard

Session Replay across multiple iframes simultaneously

Open damacisaac opened this issue 1 year ago • 8 comments

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. On a top level domain, open two iframes that both initialize Sentry Replay
  2. Interact with both iframes

Expected Result

Unsure what would be the best expected result, but the current behaviour seems random. Potential solutions:

  1. Show two separate DOMs in the Replay UI
  2. Allow setting programmatically which iframe is selected for DOM playback as the session is happening.

Actual Result

It seems to randomly pick which iframe the replay session will use for its DOM. It will randomly switch between the two as the replay plays. You will, however, get breadcrumbs from both iframes within the one replay session. So both iframe sessions are being bundled together, but the replay UI is not able to show both and/or pick a single iframe to focus on.

Product Area

Replays

Link

https://coefficient.sentry.io/replays/88270d71a41c4facad571f909326d3f6/

DSN

No response

Version

No response

damacisaac avatar Aug 21 '24 16:08 damacisaac

Auto-routing to @getsentry/product-owners-replays for triage ⏲️

getsantry[bot] avatar Aug 21 '24 16:08 getsantry[bot]

Are all iframes on the same domain? If so, initializing Sentry once, on the parent page, should be enough. it should record the inner iframes

bruno-garcia avatar Aug 23 '24 21:08 bruno-garcia

@bruno-garcia The iframes are on the same domain but the parent is on a separate one.

damacisaac avatar Aug 24 '24 16:08 damacisaac

@bruno-garcia The iframes are on the same domain but the parent is on a separate one.

I see. That's not a use case we've directly worked to support at this time. Quite frankly it's the first time it comes up. Are they separated/not related sessions? Would it help if they had different session-ids basically?

bruno-garcia avatar Aug 26 '24 16:08 bruno-garcia

Definitely an unusual scenario. They're the same session. The use-case is that we're building a Google Sheets extension. The extension runs primarily in an iframe on the right side of your sheet, but you can open up dialogs that are in a separate iframe but are really the same session. Probably best would be to assign different session IDs, like you said. Is it possible to force a new ID?

damacisaac avatar Aug 26 '24 17:08 damacisaac

Would it make more sense to have them in separate projects?

billyvg avatar Aug 26 '24 17:08 billyvg

No I don't think. It's the same app running in both places and it's a single workflow so I think same project makes sense.

damacisaac avatar Aug 26 '24 17:08 damacisaac

This may be possible if we allow the session storage key to be configurable - we'll have to discuss with the team

billyvg avatar Aug 27 '24 13:08 billyvg