Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.49k stars 589 forks source link

SIGABRT Assertion failed: (database->initialized_) #1817

Closed prathameshmm02 closed 1 month ago

prathameshmm02 commented 2 months ago

First of all, thanks for the amazing library.

I am facing crashes on iOS builds with JSI enabled. App works fine when freshly installed, but crashes every time on opening after some time. And I am unable to reproduce this crash as this does not happen for every user.

Crash Log:

SIGABRT
Assertion failed: (database->initialized_), function operator(), file DatabaseBridge.cpp, line 141.
 > database->initialized_ > DatabaseBridge.cpp > operator()

React Native: 0.73.6 Expo Bare Workflow Watermelon DB version: 0.27.1

prathameshmm02 commented 1 month ago

I found the cause, this crash happens after eas update in which I have a increased the schema version and there is a migration to run. So, for schema changes I would have to release a new build. @radex do you have any idea/suggestions?

prathameshmm02 commented 1 month ago

Actually, it was just my dumb mistake in logging for migration events. Some objects used in my logger were not getting initialized at the time of running migrations, which would crash the logger method and in turn watermelon somehow. Closing this issue.