plaidev / karte-android-sdk

KARTE SDK for Android
https://karte.io/
Apache License 2.0
5 stars 3 forks source link

[core] Application crashes if the custom object associated with the event was too large. #6

Closed wasnot closed 3 years ago

wasnot commented 3 years ago

Expected Behavior

SDK works properly without a crash.

Current Behavior

Application will crash if the custom object associated with the event was too large.

Possible Solution

This issue has been fixed in core 2.9.0 https://developers.karte.io/docs/release-notes-android-sdk-v2#core-290

Steps to Reproduce

  1. Implement the SDK to fire events containing large custom objects
  2. Launch the app

Context (Environment)

This problem occurs if you are using core 2.8.0 or lower.

Detailed Description

Crash Log ``` W/CursorWindow: Window is full: requested allocation 6915905 bytes, free space 2096537 bytes, window size 2097152 bytes E/SQLiteQuery: exception: Row too big to fit into CursorWindow requiredPos=0, totalRows=1; query: SELECT * FROM events WHERE state != ? ORDER BY _id ASC E/AndroidRuntime: FATAL EXCEPTION: io.karte.android.Tracker Process: io.karte.android.sample, PID: 18314 android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=1 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:153) at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:140) at io.karte.android.utilities.datastore.DataStore$Companion.read(DataStore.kt:166) at io.karte.android.utilities.datastore.Transaction.read(Interface.kt:72) at io.karte.android.utilities.datastore.Persister$DefaultImpls.read$default(Interface.kt:39) at io.karte.android.tracking.queue.Dispatcher.run(Dispatcher.kt:107) at io.karte.android.tracking.queue.Dispatcher.access$run(Dispatcher.kt:48) at io.karte.android.tracking.queue.Dispatcher$push$2.invoke(Dispatcher.kt:84) at io.karte.android.tracking.queue.Dispatcher$push$2.invoke(Dispatcher.kt:48) at io.karte.android.tracking.queue.DispatcherKt$sam$java_lang_Runnable$0.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.os.HandlerThread.run(HandlerThread.java:67) ```

Possible Implementation

wasnot commented 3 years ago

This crash was reproduced even after core 2.9.0, and we released core 2.9.1 with additional fixes. https://developers.karte.io/docs/release-notes-android-sdk-v2#core-291