Details
- Tested query in SQLite.
Before:
Query:
After:
- Tested migration on both web and native.
- Tested creating DB from scratch on both web and native.
Diff Detail
- Repository
- rCOMM Comm
- Branch
- publish-session-resetting
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Tests are failing because of a not-yet updated entity - this is fixed in the next diff (D11580). I will land it together or merge those two diffs.
I have for questions for @kamil:
- What is the purpose of version column?
- Isn't the counter value extractable from the session object itself?
- When and how is it going to be updated? Is it possible that value in the version column will go out of sync with the counter value in the session object?
- Finally, is that going to be a problem the we don't have such counterID tracking for notifs sessions - in case it is should we implement it for notifs as well?
Answer to your questions is here but just for the record:
I have for questions for @kamil:
- What is the purpose of version column?
To track the version of olm session between two clients helps discover race conditions when to create a new session or discard an old session request.
- Isn't the counter value extractable from the session object itself?
If you're asking about olm session (not our definition of Session) - the answer is no.
- When and how is it going to be updated?
When creating a new session/accepting a session request.
Is it possible that value in the version column will go out of sync with the counter value in the session object?
Those are two completely different things.
- Finally, is that going to be a problem the we don't have such counterID tracking for notifs sessions - in case it is should we implement it for notifs as well?
We should implement it for notifs while working on DMs - now there is no need to I guess.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
634 | Nit: I would rather name it as add_version_column_to_olm_persist_sessions_table. Current name is quite generic and actually any migration on this table could be named like that. |
We should implement it for notifs while working on DMs - now there is no need to I guess.
Is there a task for this?
I think it is https://linear.app/comm/issue/ENG-7658/add-olm-session-versioning-for-notifs - is that correct @kamil ?