restcomm-android-sdk
restcomm-android-sdk copied to clipboard
SQLite unique constraint violation
Scenario:
- Message arrives from unknown contact
- Olympus tries to add this contact and it crashes because an entry with the same contact.name exists in the contact db.
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: contact.name (code 2067)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:780)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1471)
at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1367)
at org.restcomm.android.olympus.DatabaseManager.addContactIfNeded(DatabaseManager.java:152)
at org.restcomm.android.olympus.MessageActivity.handleMessage(MessageActivity.java:243)
at org.restcomm.android.olympus.MessageActivity.onServiceConnected(MessageActivity.java:196)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1225)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1242)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5442)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
TF session is here