Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow much larger notes to be loaded #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewleech
Copy link

I was getting a crash when the app tries to load a new note (made on webui) with a number of images in it:

2020-11-30 09:41:50.686 4545-4545/com.leanote.android E/SQLiteQuery: exception: Row too big to fit into CursorWindow requiredPos=236, totalRows=237; query: SELECT * FROM `Note` WHERE `userId`='57edc09449286a0034000001' AND `isDeleted`=0 AND `isTrash`=0
2020-11-30 09:41:50.687 4545-4545/com.leanote.android D/AndroidRuntime: Shutting down VM
2020-11-30 09:41:50.694 4545-4545/com.leanote.android E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.leanote.android, PID: 4545
    org.greenrobot.eventbus.EventBusException: Invoking subscriber failed
        at org.greenrobot.eventbus.EventBus.handleSubscriberException(EventBus.java:505)
        at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:487)
        at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:479)
        at org.greenrobot.eventbus.HandlerPoster.handleMessage(HandlerPoster.java:67)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
     Caused by: android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=236, totalRows=237
        at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:942)
        at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:838)
        at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
        at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:161)
        at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:131)
        at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:249)
        at android.database.AbstractCursor.moveToNext(AbstractCursor.java:281)
        at com.raizlabs.android.dbflow.sql.queriable.ListModelLoader.convertToData(ListModelLoader.java:35)
        at com.raizlabs.android.dbflow.sql.queriable.ListModelLoader.convertToData(ListModelLoader.java:15)
        at com.raizlabs.android.dbflow.sql.queriable.ModelLoader.load(ModelLoader.java:69)
        at com.raizlabs.android.dbflow.sql.queriable.ModelLoader.load(ModelLoader.java:57)
        at com.raizlabs.android.dbflow.sql.queriable.ModelLoader.load(ModelLoader.java:51)
        at com.raizlabs.android.dbflow.sql.queriable.ModelLoader.load(ModelLoader.java:35)
        at com.raizlabs.android.dbflow.sql.language.BaseModelQueriable.queryList(BaseModelQueriable.java:53)
        at com.raizlabs.android.dbflow.sql.language.Where.queryList(Where.java:237)
        at org.houxg.leamonax.database.NoteDataStore.getAllNotes(NoteDataStore.java:138)
        at org.houxg.leamonax.ui.NoteFragment.setMode(NoteFragment.java:157)
        at org.houxg.leamonax.ui.MainActivity.onShowNotes(MainActivity.java:181)
        at org.houxg.leamonax.ui.Navigation.refresh(Navigation.java:466)
        at org.houxg.leamonax.ui.MainActivity.onEvent(MainActivity.java:202)

This error SQLiteQuery: exception: Row too big to fit into CursorWindow is widely reported as a restriction in newer android versions. I implemented this fix from andpor/react-native-sqlite-storage#364 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant