-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
ref: functions to convert to/from enum cases #2108
Conversation
Performance metrics 🚀
|
781c867
to
e4cf66b
Compare
I'm stumped as to why there are duplicate symbols for the exported constants in SentryDiscardReasonMapper.h. It has the same implementation pattern as e.g. SentryDataCategoryMapper.h. Those headers and the corresponding headers defining the enums are in the same Headers Build Phase for the framework target. The test apps iOS-Swift et al build fine. @philipphofmann any ideas? I can start pulling apart the integration tests to test them locally but not sure if that'll actually help me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I like the refactoring a lot. Can we merge this soon? Otherwise, we could get hard to resolve conflicts easily.
Ah i forgot to mark this as ready for review before I left. It's ready now @philipphofmann 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice. Im a little worried about all the generic names used for global symbols.
- remove duplicate tests - add tests for going from name->level - use C functions instead of ObjC methods
- deduplicated method that parses data categories for rate limits with one mod, which is inlined at the call site - add tests and add degenerate cases for converting an unexpected string/numeric value to enum case
883003b
to
5650f77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this lovely refactoring, @armcknight.
|
||
NS_ASSUME_NONNULL_BEGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l
: Why don't we keep NS_ASSUME_NONNULL_BEGIN
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only really makes sense for header files, or maybe prototypes, interface extensions or block type declarations in an implementation file. Even the _Nonnull
in this file I copied accidentally from the prototype in the header and could be removed.
|
||
// Unknown categories must be ignored | ||
if (category != kSentryDataCategoryUnknown) { | ||
// Unknown categories must be ignored. UserFeedback is not listed for rate limits, see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for keeping this important comment.
* master: (73 commits) ref: Fix typo in measurement (#2154) Fix typos in changelog (#2153) docs: Add a note on flaky tests to Contributing (#2161) docs: fix PR reference in CHANGELOG (#2157) test: generate graphs for benchmarks (#2158) release: 7.25.1 fix: Prewarmed app start detection (#2151) ci: temporarily disable scheduled CI runs uploading profiles/symbols (#2152) Run tests on iOS 16 using Xcode 14.0 (#2147) ref: Fix Xcode 14 compile issues (#2145) Provide fallbacks for assertions in production (#2141) Fix compile errors in Xcode 14 (#2146) release: 7.25.0 fix: setting SDK name through options[sdk][name] shouldn't clear version (#2139) fix: SentryTracer instances should be called "tracer", not "transaction" (#2137) ref: functions to convert to/from enum cases (#2108) fix: Crash with screenshot is reported twice (#2134) meta: Clarify PR rules in Contributing (#2133) meta: Fix Changelog (#2136) feat: Add support for dynamic library (#1726) ...
Closes #2088
Each enum handled in a separate commit, recommend viewing the PR one commit at a time.
#skip-changelog