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

Replay: user taps crumbs have null message on iOS #2341

Open
bruno-garcia opened this issue Oct 9, 2024 · 8 comments
Open

Replay: user taps crumbs have null message on iOS #2341

bruno-garcia opened this issue Oct 9, 2024 · 8 comments
Assignees

Comments

@bruno-garcia
Copy link
Member

Description

The crumb message field seems null. And the UI/compoent requires a value.

SDK version: 8.36.0 (running on iOS)

Image

See:

@vaind
Copy link
Collaborator

vaind commented Oct 9, 2024

How did you reproduce this? I've just checked here in the flutter sample app and all looks good.
Image

Interestingly, the screenshot shows "User click" while it should be "User tap".

@bruno-garcia
Copy link
Member Author

Not sure, this was a user event. But it wasn't a manually created breadcrumb.

@vaind
Copy link
Collaborator

vaind commented Oct 10, 2024

If I explicitly send nil as the message, it shows up as:
Image

Any chance we can get (anonymized) json payload from the replay event?

@vaind
Copy link
Collaborator

vaind commented Oct 11, 2024

I don't believe there's anything to do in the Flutter SDK with the details we have available in the issue. At the very least, someone familiar with the UI could verify why taps are shown in breadcrumbs as clicks (if they're indeed taps)

@bruno-garcia
Copy link
Member Author

In that case, @c298lee I think we should merge the PR that deals with the data being null

@c298lee
Copy link
Member

c298lee commented Oct 15, 2024

There are User Click breadcrumbs and User Tap breadcrumbs. User Tap breadcrumbs have the category user.tap and is a mobile only breadcrumb. User Click breadcrumbs have the category user.click and in our UI, we expect it to have a message which contains which element was clicked. I believe this should be a web specific breadcrumb, so I'm not sure why it's showing up in a mobile replay.

I'll repoen the PR that deals specifically with user click data being null first to resolve this issue. However, it looks like web breadcrumbs are somehow showing up in a mobile replay, and I think we should look into how that's happening. Maybe they set up custom breadcrumbs with the category ui.click?

@vaind
Copy link
Collaborator

vaind commented Oct 15, 2024

Maybe they set up custom breadcrumbs with the category ui.click?

That still shouldn't get to replay because we convert all ui.click breadcrumbs, regardless of being set by the SDK or user, to ui.tap in Flutter:

- (id<SentryRRWebEvent> _Nullable)convertFrom:
(SentryBreadcrumb *_Nonnull)breadcrumb {
assert(breadcrumb.timestamp != nil);
if (breadcrumb.category == nil
// Do not add Sentry Event breadcrumbs to replay
|| [breadcrumb.category isEqualToString:@"sentry.event"] ||
[breadcrumb.category isEqualToString:@"sentry.transaction"]) {
return nil;
}
if ([breadcrumb.category isEqualToString:@"http"]) {
return [self convertNetwork:breadcrumb];
}
if ([breadcrumb.category isEqualToString:@"navigation"]) {
return [self convertFrom:breadcrumb withCategory:nil andMessage:nil];
}
if ([breadcrumb.category isEqualToString:@"ui.click"]) {
return [self convertFrom:breadcrumb
withCategory:@"ui.tap"
andMessage:[self getTouchPathMessage:breadcrumb.data[@"path"]]];
}

override fun convert(breadcrumb: Breadcrumb): RRWebEvent? {
return when (breadcrumb.category) {
null -> null
"sentry.event" -> null
"sentry.transaction" -> null
"http" -> convertNetworkBreadcrumb(breadcrumb)
"navigation" -> newRRWebBreadcrumb(breadcrumb)
"ui.click" ->
newRRWebBreadcrumb(breadcrumb).apply {
category = "ui.tap"
message = getTouchPathMessage(breadcrumb.data["path"])
}
else -> {
val nativeBreadcrumb = super.convert(breadcrumb)
// ignore native navigation breadcrumbs
if (nativeBreadcrumb is RRWebBreadcrumbEvent) {
if (nativeBreadcrumb.category == "navigation") {
return null
}
}
nativeBreadcrumb
}
}
}

Are we 100% sure that event is coming from Flutter? Because AFAICT, in plain cocoa SDK, the ui.click breadcrumb would just get passed on directly (i.e. what you've suggested might be happening)

@c298lee
Copy link
Member

c298lee commented Oct 15, 2024

From looking at the tags in the replays with these errors, it looks like they are happening on sentry.cocoa.flutter version 8.36.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Discussion
Development

No branches or pull requests

3 participants