Skip to content
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

Provide fallbacks for assertions in production #2141

Merged
merged 2 commits into from
Sep 13, 2022

Conversation

kevinrenskers
Copy link
Contributor

Provide fallbacks for assertions in production.

Closes #2109
#skip-changelog

@@ -20,6 +20,9 @@ @implementation SentrySwizzleInfo
- (SentrySwizzleOriginalIMP)getOriginalImplementation
{
NSAssert(_impProviderBlock, nil);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@armcknight mentioned the redundant nil here, but if I remove it the code no longer compiles 🤔
Too few arguments provided to function-like macro invocation

So I guess the nil was added with good reason. Or we could give it a proper string instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a message, otherwise we get an assertion/exception with an empty message
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically in the past I've wrapped this in a macro like SENTRY_ASSERT_NONNULL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a message

@github-actions
Copy link

github-actions bot commented Sep 12, 2022

Performance metrics 🚀

Plain With Sentry Diff
Startup time (ms) 1236.57 1253.96 17.38
Size (bytes) 21157 333612 312455

@kevinrenskers kevinrenskers merged commit 7575997 into master Sep 13, 2022
@kevinrenskers kevinrenskers deleted the fix/2109-assertion-fallbacks branch September 13, 2022 09:55
kevinrenskers added a commit that referenced this pull request Sep 13, 2022
* master:
  Run tests on iOS 16 using Xcode 14.0 (#2147)
  ref: Fix Xcode 14 compile issues (#2145)
  Provide fallbacks for assertions in production (#2141)

# Conflicts:
#	scripts/xcode-test.sh
kevinrenskers added a commit that referenced this pull request Sep 15, 2022
* 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)
  ...
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.

Provide fallbacks for assertions in production
2 participants