Read desktop code version during socket connection creation
Summary:
This differential resolves urgent issue available under: https://linear.app/comm/issue/ENG-6007/macos-desktop-version-is-not-actually-exported-to-the-keyserver.
The issue consisted of 3 parts:
- During socket connection creation the keyserver simply ignored potential majorDesktopVersion field.
- The code in message-creator.js tried to read desktop code version from the database by looking for desktopCodeVersion field in fetched rows while it was actually persisted as majorDesktopVersion.
- Finally versionKeyRegex allowed exclusively strings in <number>|<number> format but we need it to allow <number>|<number>|<number> as well.
This differential addresses each of the issues listed above.
Test Plan:
- Build desktop app connected to your local keyserver.
- Ensure that olm sessions are present both in MariaDB and IndexedDB.
- Send some notifications and ensure that version field is incremented with each notification.
Repeat for both dev and prod (testing for prod will require to remove isStaffOrDev condition).
Execute similar test for web and native (for native ignore IndexedDB check) in order to test that functionality for this platforms is not broken.
It is essential to note that my initial testing plans for the entire e2e MacOS notifications assumed that NEXT_CODE_VERSION was temporarily updated to 0 which was the root of the issue this differential resolves. This testing plan assumes that no changes to NEXT_CODE_VERSION are done and that it is executed on the master code as it is.
Reviewers: michal, kamil
Reviewed By: michal
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10151