Coder Social home page Coder Social logo

Comments (11)

marandaneto avatar marandaneto commented on June 18, 2024

Thanks @Legion2 .
We'll check it and come back to you.
@buenaflor have you seen that before? or @romtsn ?

from sentry-kotlin-multiplatform.

romtsn avatar romtsn commented on June 18, 2024

Thanks @Legion2 . We'll check it and come back to you. @buenaflor have you seen that before? or @romtsn ?

no, first time seeing this. I guess we have to investigate with debugger attached to see what's going on

from sentry-kotlin-multiplatform.

Legion2 avatar Legion2 commented on June 18, 2024

Short question: When is the beforeSend hook supposed to be executed:

  1. when the exception is thrown/catched and converted to an event, or
  2. before the event is send to sentry which is possibly much later than when it was catched (possibly after application restart)?

from sentry-kotlin-multiplatform.

marandaneto avatar marandaneto commented on June 18, 2024

@Legion2 before the event is sent after the event is "ready" and enriched.
It depends on the platform:
iOS is after the app is restarted
Android usually before the process dies, but it can be on restart as well.

from sentry-kotlin-multiplatform.

buenaflor avatar buenaflor commented on June 18, 2024

@Legion2 hi, thanks for bringing up the issue. What kind of error are you throwing in your activity? It's definitely weird that beforeSend is not being triggered. I'm trying to reproduce this issue but it seems to be working on my end. Can you show a code sample of your activity?, just to be sure.

from sentry-kotlin-multiplatform.

Legion2 avatar Legion2 commented on June 18, 2024

Initially a Unable to start activity ComponentInfo {...} androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment ...: could not find Fragment constructor caught my attention, because it was logged to sentry and had the tag mechanism: UncaughtExceptionHandler and handled: false in sentry, however we use the above beforeSend to filter such exceptions. (Use case: We provide an sdk which is integrated in 3rd party apps, we do not want to catch all errors of the 3rd party app and send them to our sentry, because they are not actionable for us)
When I tried to reproduce this in a debug version of a demo app with a debugger attached and breakpoint set in the beforeSend hook I used error("test") to throw an exception in the onCreate of the main activity to reproduce a fatal exception. During the testing I could never trigger the breakpoint in beforeSend callback.

from sentry-kotlin-multiplatform.

buenaflor avatar buenaflor commented on June 18, 2024

@Legion2 could you prepare a little demo repo that reproduces this issue?

Other than that we do not officially support using Sentry within other sdks.

from sentry-kotlin-multiplatform.

buenaflor avatar buenaflor commented on June 18, 2024

Closing this due to inactivity

from sentry-kotlin-multiplatform.

Legion2 avatar Legion2 commented on June 18, 2024

I think this issue is related to double initialization of SentrySDK, we are using React Native Sentry SDK and Kotlin Multiplatform SDK at the same type and they both initialize the Android SDK and there by overriding each others settings.
@buenaflor I was not able to find any documentation about that case and assume that it is not supported.

from sentry-kotlin-multiplatform.

buenaflor avatar buenaflor commented on June 18, 2024

@Legion2 most likely yes that's the case. and yes the SDKs are not written with these cases in mind unfortunately

from sentry-kotlin-multiplatform.

Legion2 avatar Legion2 commented on June 18, 2024

I found this flag today (https://docs.sentry.io/platforms/react-native/manual-setup/native-init/) and hope this will fix most of the issues we have.

from sentry-kotlin-multiplatform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.