Page MenuHomePhabricator

[lib] Make resolveKeyserverSessionInvalidation generic
ClosedPublic

Authored by ashoat on Mar 3 2024, 9:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 13, 12:15 AM
Unknown Object (File)
Apr 4 2024, 6:43 PM
Unknown Object (File)
Apr 2 2024, 2:13 AM
Unknown Object (File)
Mar 22 2024, 1:41 PM
Unknown Object (File)
Mar 18 2024, 11:24 AM
Unknown Object (File)
Mar 16 2024, 4:09 PM
Unknown Object (File)
Mar 16 2024, 12:14 PM
Unknown Object (File)
Mar 12 2024, 5:07 PM
Subscribers
None

Details

Summary

This diff factors out the "business logic" in resolveKeyserverSessionInvalidation, making it possible to use the function with the new identity service-based keyserver auth.

SQLiteDataHandler on native is the only callsite that remains outside of KeyserverConnectionHandler. It needs to remain special-cased because SQLiteDataHandler does its work before KeyserverConnectionHandler is rendered, since KeyserverConnectionHandler depends on data being loaded into Redux. In a later diff I'll address how SQLiteDataHandler will work in the multi-keyserver world, but the short story is that it will need to re-load data from the backup service rather than from the authoritative keyserver.

NOTE: The recovery logic in SQLiteDataHandler is broken here because it doesn't directly dispatch setNewSession. This was broken in D10952, and will be fixed in a later diff. I decided not to fix this up earlier because it would require introducing code that would later be ripped out.

Depends on D11224

Test Plan

I used this test plan for the whole stack: https://gist.github.com/Ashoat/75ab690d5c53cdd68a51b02e03e27c58

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat requested review of this revision.Mar 3 2024, 9:58 PM
tomek added inline comments.
native/data/sqlite-data-handler.js
71–77 ↗(On Diff #37758)

We can avoid this invariant by importing the function directly from the file import { resolveKeyserverSessionInvalidationUsingNativeCredentials } from './account/legacy-recover-keyserver-session.js';

This revision is now accepted and ready to land.Mar 5 2024, 6:03 AM

Directly import resolveKeyserverSessionInvalidationUsingNativeCredentials

native/data/sqlite-data-handler.js
71–77 ↗(On Diff #37758)

Good call