Decouple SentryAndroid initialisation from Events sending #1751
Unanswered
pchoroscin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
SentryAndroid does call
installDefaultIntegrations
ininit
Method.There are some integrations included that are not "the best" choice for my use case.
(
SendCachedEventFireAndForgetIntegration
andEnvelopeFileObserverIntegration
I suppose).The workflow I do want to achieve is following (assuming #1739 is closed by the time):
Sadly, because of coupling
SentryAndroid.init
withSendCachedEventFireAndForgetIntegration
, the crash reports are being sent once the app was started after crash. So it's impossible to achieve step 2. having done step 1., isn't it?Could the initialisation of the framework (that is initialisation of collecting breadcrumbs etc.) be decoupled from sending the cached events? And could sending the events be made "on-demand"?
I assume it's impossible because of coupling
SendCachedEventFireAndForgetIntegration
integration'sregister
method to submitting sending tasks, isn't it? And there is no clean way to enable/disable it on demand.It might be way of doing it by implementing custom
TransportGate
, but how to invokeSendCachedEventFireAndForgetIntegration
later, once we need to send the event? (see point 5.)Also sending the crash event should not be done after the crash, by on-demand on the next start of the app (
UncaughtExceptionHandlerIntegration
seems to do the opposite by default?)Maybe it's worth opening an issue for that?
Beta Was this translation helpful? Give feedback.
All reactions