getsentry / getsentry/sentry-cocoa
Constants for keys used in data dictionary of Breadcrump object
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 418
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 106
Description
### Problem Statement
I want to have safer experience when modifying built-in breadcrumbs but Sentry doesn't expose keys as constants
Example: safer sanitising of http breadcrumps.
### Solution Brainstorm
The easiest way to achieve a certain level of safety is to define a list of constants for each built-in breadcrumb Sentry currently reports.
**Before:**
```
options.beforeBreadcrumb = {
... data["http.query"] ...
...
}
```
**After:**
```
options.beforeBreadcrumb = {
... data[Sentry.Breadcrump.Http.QueryDataKey] ...
...
}
```
Even it's not the best way to handle passing data with a breadcrumb, it represents way safer solution because there is a connection established between providers and consumers.
Alternatively, this section could be completely restructured, and the data object could be of the 'Any' type. This would allow the client to cast the 'Any' type object to a specific type, such as 'HttpBreadcrumbData', which would be defined within Sentry
### Are you willing to submit a PR?
Yes, I can consider working on it
Contributor guide
Assessment
This issue has not been assessed yet.