Skip to content

Sentry React Native promise patching causes problems in ClojureScript advanced compilation #157

Description

@viesti

It seems that when using Sentry, promises break in ClojureScript advanced compilation. I didn't investigate too deep yet, but seems as if, for example in .then and p/then calls, the argument is somehow a promise and not the value.

Sentry documentation has instructions for disabling it's automatic patching of Promises, which seems to help: https://docs.sentry.io/platforms/react-native/troubleshooting/#disable-auto-patching

  (sentry/init
   (->js {...
          ;; Seems to break promises in CLJS advanced build
          :patchGlobalPromise false
...

Activity

  1. changed the title [-]Sentry React Native promises[/-] [+]Sentry React Native promise patching causes problems in ClojureScript advanced compilation[/+] on May 6, 2025
  2. niwinz commented on May 6, 2025

    @niwinz
    Member

    Hmm, it is possible yes, because promesa has its own implementation of Promise for make it work in both mode: autflatten (.then) and not flatten (.fmap, same semantics as JVM completableFuture).

    It is clearly a possible that something in sentry monky patching is doing that is not OK with our impl. We need research.

    Thanks for reporting

  3. viesti commented on May 6, 2025

    @viesti
    Author

    Thanks for the fast response!

    Wanted to leave this just as info if someone else runs into this, the :patchGlobalPromise false helped me :)

    Promesa is cool! Don't want to force more new work for you :)

    I can research what is going on if I have time :)

  4. niwinz commented on May 11, 2025

    @niwinz
    Member

    Any insight would be nice, because I'm not clearly know how to investigate this without running it in context of sentry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions