You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update outcomes table to include session_time column
* Update database version to v9 and make migration.
* I default this new `session_time` to a value of `1` instead of `0` intentionally to work around an issue from the v5.0.0-beta's for migration's sake and get these outcomes migrated, sent, and done with.
* When outcome requests fail, they are cached for retrying. The v5.0.0-beta's likely encountered failure responses and cached these. If there are cached `os__session_duration` outcomes and we send them off with zero session_time, the server will keep sending us a failure response. So, let's just send a time of 1 second.
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/session/internal/outcomes/impl/OutcomeTableProvider.kt
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,24 @@ internal class OutcomeTableProvider {
78
78
}
79
79
}
80
80
81
+
/**
82
+
* On the outcome table this adds the new session_time column.
// We intentionally choose to default session_time to 1 to address a bug on cached outcomes from v5.0.0-beta's
91
+
// os__session_duration requests expect a session_time and these will keep failing and caching, so let's just send them with a time of 1 for migrations
92
+
} catch (e:SQLiteException) {
93
+
e.printStackTrace()
94
+
} finally {
95
+
db.execSQL("COMMIT;")
96
+
}
97
+
}
98
+
81
99
/**
82
100
* On the cache unique outcome table rename table, rename column notification id to influence id
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/session/internal/outcomes/impl/OutcomesDbContract.kt
0 commit comments