Skip to content

6791 - Sentry: SecurityError — removeEventListener from cross-origin Window #6792

Open
n-lark wants to merge 2 commits intomainfrom
6791-iframe-securityError
Open

6791 - Sentry: SecurityError — removeEventListener from cross-origin Window #6792
n-lark wants to merge 2 commits intomainfrom
6791-iframe-securityError

Conversation

@n-lark
Copy link

@n-lark n-lark commented Mar 3, 2026

Description

Fixes a SecurityError: Failed to read a named property 'removeEventListener' from 'Window' triggered when navigating away from the instance editor.

The error was caused by PostHog's rrweb-based session recorder failing to detach from the cross-origin Node-RED iframe during route teardown. Fixed by clearing the iframe src to about:blank in beforeUnmount on both HostedInstanceEditorWrapper and RemoteInstanceEditorWrapper — making the iframe same-origin at cleanup time so the browser permits the listener removal.

Full details here.

Related Issue(s)

Resolves #6791

Checklist

This is a config change.

  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@n-lark n-lark requested a review from cstns March 3, 2026 21:31
@n-lark n-lark self-assigned this Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.60%. Comparing base (d958009) to head (b5bded0).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6792      +/-   ##
==========================================
- Coverage   76.65%   76.60%   -0.06%     
==========================================
  Files         398      398              
  Lines       20108    20122      +14     
  Branches     4844     4844              
==========================================
  Hits        15414    15414              
- Misses       4694     4708      +14     
Flag Coverage Δ
backend 76.60% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@n-lark n-lark marked this pull request as ready for review March 4, 2026 19:12
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.

Sentry: SecurityError — removeEventListener from cross-origin Window

1 participant