Closed pbrisbin closed 6 years ago
I think there's no reasonable use-case for this being library-provided. For better or worse, the Bugsnag API considers a single, event-wide groupingHash
. This means we're unlikely to do any kind of Exception-specific grouping and Event-wide grouping, that would need to compose.
We expose setGroupingHash
and setGroupingHashWith
to determine the (single) hash based on the (single) Event. This is limiting, but also means that you have full control over composing different strategies based on static context or Event details (which implicitly includes the Exception(s) therein).
Right now we can set a "Grouping Hash" on an event directly, or based on a central
Event -> Maybe Text
hook in Settings. This is a very low-level (i.e. error-prone) way to do it.I'm trying to think of a nicer way to make different grouping "strategies" declarable and composable, such that applying grouping logic from two different places won't just overwrite them depending on order.
A concrete example:
SqlError
by its error-codeThe requirements are that if we apply both (attempted) groupings to some event are:
g1 e1 == g1 e2
)g2 e1 == g2 e2
)(g1 • g2) e1 == (g1 • g2) e2
)(Obvious cases omitted)
I feel like there's some kind of generic combinator we can use to get here, possibly depending on our choices for cases (1) and (2), on which I'm flexible.