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

feat: Expose SentryFileManager and SentryCurrentDateProvider #835

Closed
wants to merge 2 commits into from

Conversation

jennmueng
Copy link
Member

@jennmueng jennmueng commented Nov 8, 2020

📜 Description

Expose SentryFileManager.h and SentryCurrentDateProvider.h to be public as @sentry/react-native uses them.

💡 Motivation and Context

Directly importing private header files caused issued for users that use use_frameworks! in their Podfile: getsentry/sentry-react-native#1171

💚 How did you test it?

Linked to this branch locally with our react native sample app and confirmed that the issue is gone when using use_frameworks!.

📝 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

Corresponding PR for React Native to follow that no longer directly imports these header files.

@jennmueng jennmueng marked this pull request as ready for review November 8, 2020 14:15
@philipphofmann
Copy link
Member

If I'm not mistaken react-native only needs storeEnvelope of SentryFileManager, https://github.com/getsentry/sentry-react-native/blob/16a4f1dcba45bdb80f65c2ae300edf9a90bd8b8f/ios/RNSentry.m#L151. What about adding a method storeEnvelope to the SentryClient or even SentrySDK or SentryHub, which wraps the call to the SentryFileManager? This would have the advantage of not exposing the whole SentryFileManager. What do you think about that @HazAT? This shouldn't be a breaking change as SentryFileManager was not public anyways.

@HazAT
Copy link
Member

HazAT commented Nov 9, 2020

Hmm, we could also do that, but let's just add it to the SentryClient and nowhere else.
With that we can use it internally but not too much is exposed.

philipphofmann added a commit that referenced this pull request Nov 9, 2020
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.
philipphofmann added a commit that referenced this pull request Nov 9, 2020
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.
@philipphofmann
Copy link
Member

Suggested change opened in #836

@bruno-garcia bruno-garcia deleted the feat/expose-file-manager branch November 9, 2020 18:24
philipphofmann added a commit that referenced this pull request Nov 10, 2020
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.
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