Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: widget masks overlap when navigating between screens. #2486

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thisames
Copy link

📜 Description

At first I thought it would be necessary to implement a way to scrape widgets by context, as I did in posthog, but I realized that your code was already correct, it just needs one adjustment.

applying debugVisitOnstageChildren to your children does exactly what we were looking for. a way to "separate the elements that are hidden and not interactive from the active elements in the current context of the screen"

💡 Motivation and Context

widget masks overlap when navigating between screens.

#2309

💚 How did you test it?

I just did several tests with different navigations and applications, checking and debugging the widgets

2024-12-11.21-50-19.mp4

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@@ -80,7 +80,7 @@ class WidgetFilter {
break;
case SentryMaskingDecision.continueProcessing:
// If this element should not be obscured, visit and check its children.
element.visitChildElements(_visitList.add);
element.debugVisitOnstageChildren(_visitList.add);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be 100% reliable. So far in my testing, I've seen one occasion when masks were off. Never seen that before. I'll check the implementations of debugVisitOnstageChildren().

In the following screenshot (and the correct one for reference), it seems way off. Note: this has been taken while scrolling rapidly.
image
image

Copy link
Author

@thisames thisames Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What app are you testing with? I would like to reproduce the same time, but besides that, in my tests if I scroll quickly with visitChildElements the same thing will happen (masks were off).

try comparing the test you just did using visitChildElements and debugVisitOnstageChildren.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What app are you testing with?
https://github.com/vaind/spotube/tree/sentry

in my tests if I scroll quickly with visitChildElements the same thing will happen (masks were off).
try comparing the test you just did using visitChildElements and debugVisitOnstageChildren.

Interesting, I've never noticed that before. If you have a good repro you could shere for this, I'd like to take a look.

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.

2 participants