Skip to content

feat: Add storeEnvelope on SentryClient #836

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

Merged
merged 3 commits into from
Nov 10, 2020
Merged

Conversation

philipphofmann
Copy link
Member

📜 Description

Hybrid SDKs as react-native need a way to synchronously store an envelope to disk. Previously, this
was possible by exposing SentryFileManager on the SentryClient, but this breaks users of
react-native that use use_frameworks!,
see getsentry/sentry-react-native#1171. A way to fix this would be to expose
SentryFileManager and SentryCurrentDateProvider as proposed in
#835. This has the downside of making classes public,
that shouldn't be public. A better workaround is to expose storeEnvelope on the SentryClient.

💡 Motivation and Context

See #835.

💚 How did you test it?

Unit tests and CI.

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the CHANGELOG
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
philipphofmann Philipp Hofmann
Hybrid SDKs as react-native need a way to synchronously store an envelope to disk. Previously, this
was possible by exposing SentryFileManager on the SentryClient, but this breaks users of
react-native that use use_frameworks!,
see getsentry/sentry-react-native#1171. A way to fix this would be to expose
SentryFileManager and SentryCurrentDateProvider as proposed in
#835. This has the downside of making classes public,
that shouldn't be public. A better workaround is to expose storeEnvelope on the SentryClient.
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

Good call! much cleaner

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@codecov-io
Copy link

codecov-io commented Nov 10, 2020

Codecov Report

Merging #836 (b3fe46e) into master (21f33ed) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #836      +/-   ##
==========================================
- Coverage   83.49%   83.47%   -0.03%     
==========================================
  Files         237      237              
  Lines       18482    18488       +6     
==========================================
+ Hits        15432    15433       +1     
- Misses       3050     3055       +5     
Impacted Files Coverage Δ
Sources/Sentry/SentrySessionCrashedHandler.m 100.00% <ø> (ø)
Sources/Sentry/SentrySessionTracker.m 100.00% <ø> (ø)
Sources/Sentry/SentryClient.m 92.81% <100.00%> (+0.03%) ⬆️
Tests/SentryTests/SentryClientTests.swift 98.91% <100.00%> (+0.01%) ⬆️
Tests/SentryTests/SentryHubTests.swift 98.66% <100.00%> (ø)
...tryCrash/Recording/Tools/SentryCrashSymbolicator.c 66.66% <0.00%> (-33.34%) ⬇️
...ryCrash/Recording/Tools/SentryCrashDynamicLinker.c 84.39% <0.00%> (-0.58%) ⬇️
Sources/Sentry/SentrySDK.m 66.66% <0.00%> (+1.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21f33ed...b3fe46e. Read the comment docs.

@philipphofmann
Copy link
Member Author

Still waiting for feedback from @jennmueng, if this works for react-native.

Copy link
Member

@jennmueng jennmueng left a comment

Choose a reason for hiding this comment

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

@philipphofmann Confirmed that it works on React Native with use_frameworks! in the Podfile.

@philipphofmann philipphofmann merged commit c34b906 into master Nov 10, 2020
@philipphofmann philipphofmann deleted the feat/store-envelope branch November 10, 2020 13:46
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.

None yet

4 participants