Skip to content

Conversation

buenaflor
Copy link
Contributor

Ref #114

Eliminates the need for context in init - context can be passed in through a simple ContextProvider.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 10, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 61a646d

Copy link
Member

@markushi markushi left a comment

Choose a reason for hiding this comment

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

Nice one, LGTM!

@BeforeTest
open fun setUp() {
// Set up the provider needed for Sentry.init on Android
val provider = Robolectric.buildContentProvider(ContextProvider::class.java)
Copy link
Member

Choose a reason for hiding this comment

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

Didn't know that one, nice!

* This does not allow for overriding the abstract query, insert, update, and delete operations
* of the [ContentProvider].
*/
internal class ContextProvider : ContentProvider() {
Copy link
Member

Choose a reason for hiding this comment

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

I think the default proguard rules already exclude any ContentProvider classes from being obfuscated these days, but maybe worth double checking if the name is kept in a release build.

Copy link
Contributor Author

@buenaflor buenaflor Aug 16, 2023

Choose a reason for hiding this comment

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

Yup, it's not obfuscated in the release build

@buenaflor buenaflor merged commit 7db2950 into main Aug 16, 2023
@buenaflor buenaflor deleted the feat/remove-context-from-init branch August 16, 2023 08:17
ArnyminerZ added a commit to FilaMagenta/App that referenced this pull request Nov 14, 2023
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants