Closed martin-ecatch closed 4 weeks ago
good catch, I wasn't aware of the mistake when porting from the websql adapter.
too bad to hear that. maybe you can help him? https://github.com/craftzdog/pouchdb-adapter-react-native-sqlite/pull/24#issuecomment-2287201302
This is a fix for ticket #26 (Intermittent errors when reading form a view for the first time). There was an extra callback(null) on line 11 in index.ts. This was called without waiting for the database setup. The callback gets called in the correct place in core.ts line 124, so the line 11 in index.ts was superfluous (and the root cause of the race condition).
btw, thank you for this plugin! My Expo app relies on PouchDB and this saved me after Expo decided to completely change their SQLite API.