cordova-plugin-sqlite-2
cordova-plugin-sqlite-2 copied to clipboard
Android: should throw meaningful errors when the 1MB CursorWindow limit is reached
Currently these errors just get swallowed, e.g.: https://github.com/pouchdb/pouchdb/issues/5413
We just return empty results which causes bugs later on down the line that are hard to diagnose: https://github.com/nolanlawson/cordova-plugin-sqlite-2/blob/33afdef8409b8782b7a82ca7d59270e7e11541dd/src/android/SQLitePlugin.java#L93-L96
Hm interestingly this doesn't seem to actually throw an error we can catch; it just returns empty rows. Although it does log:
12-18 12:49:43.189 21171 21346 W CursorWindow: Window is full: requested allocation 2236848 bytes, free space 2096672 bytes, window size 2097152 bytes
12-18 12:49:43.205 21171 21346 W CursorWindow: Window is full: requested allocation 2236848 bytes, free space 2096672 bytes, window size 2097152 bytes
Hm from googling around I really don't see any way to actually detect this error in code. :confused:
Related issue at andpor/react-native-sqlite-storage#364