Conversation
jamescrosswell
left a comment
There was a problem hiding this comment.
LGTM.
About the only thing I couldn't see (maybe I missed it) is where MauiButtonEventsBinder gets tested. I see tests for MauiImageButtonEventsBinder.
If these are missing, would be good to add them before merge.
|
ImageButton tests are under MauiEventsBinder.ImageButton. |
Yeah I saw those. I didn't see any equivalent for |
|
They already existed. I only moved button code out of the original mauieventbinder into its own element binder |
Do you know where they are? Rider couldn't find any references to |
|
Sentry.Maui/Internals/MauiButtonEventsBinder & Sentry.Maui/Internals/MauiImageButtonEventsBinder |
Yeah I saw the classes... I didn't see the tests. I think this is them though: |
| _hub.AddBreadcrumbForEvent( | ||
| _options, | ||
| breadcrumb.Sender, | ||
| breadcrumb.EventName, |
There was a problem hiding this comment.
@jamescrosswell I'm sorry for this late review but I just realized there's a huge bug here.
What about breadcrumb.ExtraData? I think you completely missed it.
Also I don't find the ExtraData type very convenient.
I think that this could be more convenient:
public record BreadcrumbEvent(
object? Sender,
string EventName,
params (string Key, string Value)[] ExtraData
);
There was a problem hiding this comment.
internal void OnBreadcrumbCreateCallback(BreadcrumbEvent breadcrumb)
{
void AddExtraData(Dictionary<string, string> extraData)
{
foreach (var data in breadcrumb.ExtraData.SelectMany(d => d))
{
extraData[data.Key] = data.Value;
}
}
_hub.AddBreadcrumbForEvent(
_options,
breadcrumb.Sender,
breadcrumb.EventName,
UserType,
UserActionCategory,
AddExtraData
);
}
There was a problem hiding this comment.
Good catch @albyrock87 - I've added #4252 to track this:
Implements #3996