Page MenuHomePhabricator

Add method to check for missing olm sessions for notifs and use it to send relevant request
ClosedPublic

Authored by marcin on May 18 2023, 4:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 5:12 PM
Unknown Object (File)
Sat, Nov 9, 5:12 PM
Unknown Object (File)
Fri, Nov 8, 10:09 PM
Unknown Object (File)
Tue, Nov 5, 9:02 AM
Unknown Object (File)
Tue, Nov 5, 9:02 AM
Unknown Object (File)
Tue, Nov 5, 9:02 AM
Unknown Object (File)
Tue, Nov 5, 9:02 AM
Unknown Object (File)
Tue, Nov 5, 9:02 AM
Subscribers

Details

Summary

This differential introduces methods on the keyeserver to check if olm sessions for notifs is missing and sends relevant request to client in case it is.

Test Plan
  1. Log out.
  2. Comment the code on native in log in panel that establishes olm session for notifs.
  3. Add console.log in the kesyerver to print if it is sending request for initial notifications encrypted message.
  4. Log in. Examine the logs.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

keyserver/src/session/cookies.js
833 ↗(On Diff #26633)

Can you use FUTURE_CODE_VERSION here?

840 ↗(On Diff #26633)

Skip the semicolon to match codebase conventions for formatting MySQL queries

  1. Use FUTURE_CODE_VERSION
  2. Match SQL conventions
This revision is now accepted and ready to land.May 22 2023, 9:47 AM
keyserver/src/session/cookies.js
841–843 ↗(On Diff #26782)

Nit: this query is more expensive than it needs to be, since it has to return the data. If you only need to check the number of rows, you can use COUNT

(Also there is a trailing space on line 841)

Note that if you use COUNT, you won't be able to check queryResult.length === 0 anymore... instead you will need to check queryResult[0].count === 0

Use count to optimize query

ashoat added inline comments.
keyserver/src/session/cookies.js
841

There's a trailing space here. Please remove before landing!

Rebase before landing. Use real code version

keyserver/src/session/cookies.js
833 ↗(On Diff #27217)

I am really sorry for making this mistake. The condition here should be:

viewer.platformDetails.codeVersion <= 222

I will resolve this with git push to be fast.