getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.54k stars 4.12k forks source link

Session Replay across multiple iframes simultaneously #76455

Open damacisaac opened 3 weeks ago

damacisaac commented 3 weeks ago

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

getsantry[bot] commented 3 weeks ago

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

bruno-garcia commented 3 weeks ago

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

damacisaac commented 3 weeks ago

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

bruno-garcia commented 2 weeks ago

@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?

damacisaac commented 2 weeks ago

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?

billyvg commented 2 weeks ago

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

damacisaac commented 2 weeks ago

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.

billyvg commented 2 weeks ago

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