Page MenuHomePhabricator

[lib] Make resolveKeyserverSessionInvalidation generic
ClosedPublic

Authored by ashoat on Mar 3 2024, 9:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 9:32 PM
Unknown Object (File)
Sun, Nov 24, 6:54 PM
Unknown Object (File)
Oct 29 2024, 9:48 AM
Unknown Object (File)
Oct 16 2024, 3:36 PM
Unknown Object (File)
Oct 14 2024, 3:31 AM
Unknown Object (File)
Oct 4 2024, 3:27 AM
Unknown Object (File)
Oct 4 2024, 3:27 AM
Unknown Object (File)
Oct 4 2024, 3:27 AM
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
No Lint Coverage
Unit
No Test Coverage

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

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

Good call