Skip to content

Conversation

richardelms
Copy link
Contributor

@richardelms richardelms commented Sep 3, 2025

Goal

This pull request introduces support for a new "grouping discriminator" property in the Bugsnag Unity client, enabling more granular control over error event grouping. The implementation includes updates to the public API, internal client logic, native platform integrations, payload serialization, and tests to ensure proper handling and propagation of the grouping discriminator across all supported platforms.

Grouping Discriminator Feature

  • Added a new static property GroupingDiscriminator to the Bugsnag class, allowing users to get or set the grouping discriminator for error events. This is exposed as a thread-safe getter/setter on the internal Client class. [1] [2] [3]
  • Integrated grouping discriminator into event creation and serialization logic in Event, ensuring it is included in the payload and deserialized from incoming data. This also updates the IEvent interface. [1] [2] [3] [4] [5] [6]

Native Platform Support

  • Implemented platform-specific handling for grouping discriminator:
    • Android and Cocoa: Added methods to set grouping discriminator in native clients and event wrappers, and updated native bridge code. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
    • Fallback and Windows: Added no-op implementations to maintain API consistency. [1] [2]

Event Notification and Usage

  • Modified the error notification logic to pass the grouping discriminator to new events, ensuring it is included in all reported errors.

Testing and Feature Validation

  • Added and updated feature tests to verify correct propagation and behavior of the grouping discriminator field in error events, including scenarios for default, global, and callback-specific values. [1] [2]

Miscellaneous

  • Fixed argument usage in JNI array deletion for Android native method calls to prevent resource leaks. [1] [2] [3]
  • Added Android back button handling to example and test scripts for improved usability. [1] [2]

@richardelms richardelms self-assigned this Sep 3, 2025
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Sep 3, 2025

Build size impact

Format Size impact of Bugsnag (kB)
IL2CPP APK 2625.87
IL2CPP IPA 1753.45

Generated by 🚫 Danger

@richardelms richardelms merged commit 7e6ba41 into next Sep 10, 2025
17 checks passed
@richardelms richardelms deleted the plat-14730-groupingDisscriminator branch September 10, 2025 06:03
@richardelms richardelms mentioned this pull request Sep 15, 2025
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.

3 participants