Page MenuHomePhabricator

[keyserver][web] Add types for @matrix-org/olm
ClosedPublic

Authored by ashoat on Mar 9 2023, 11:37 AM.
Tags
None
Referenced Files
F3394390: D7026.id23623.diff
Sat, Nov 30, 7:28 PM
F3394316: D7026.id23589.diff
Sat, Nov 30, 7:02 PM
F3393921: D7026.diff
Sat, Nov 30, 4:31 PM
Unknown Object (File)
Thu, Nov 28, 2:35 AM
Unknown Object (File)
Thu, Nov 28, 1:38 AM
Unknown Object (File)
Mon, Nov 11, 7:47 PM
Unknown Object (File)
Sun, Nov 10, 11:13 PM
Unknown Object (File)
Sun, Nov 10, 10:59 PM
Subscribers

Details

Summary

@anunay is going to extend these. Mostly inspired by TypeScript types.

Test Plan

Flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 9 2023, 11:58 AM
Harbormaster failed remote builds in B17223: Diff 23589!
ashoat retitled this revision from [keyserver][web] Add types for @matrix-org to [keyserver][web] Add types for @matrix-org/olm.Mar 9 2023, 12:12 PM
atul requested changes to this revision.Mar 9 2023, 1:46 PM

Noted some inconsistencies with the TypeScript types. Feel free to re-request review if the omissions were intentional.

keyserver/flow-typed/npm/@matrix-org/olm_vx.x.x.js
17–19 ↗(On Diff #23593)

Looks like we're missing

unpublished_fallback_key(): string;
forget_old_fallback_key(): void;

in between fallback_key() and pickle(...).

Let me know if I'm missing something here.

39 ↗(On Diff #23593)

Can we do this instead of Object to match TypeScript types:

602258.png (154×690 px, 29 KB)

?

Let me know if I'm missing something here.

58 ↗(On Diff #23593)

Can we do this instead of Object to match TypeScript types:

6c1aae.png (160×456 px, 26 KB)

?

Let me know if I'm missing something here.

80 ↗(On Diff #23593)

Can we do this instead of Object to match TypeScript types:

014c61.png (192×482 px, 28 KB)

?

Let me know if I'm missing something here.

108–109 ↗(On Diff #23593)

Looks like we're missing

calculate_mac_fixed_base64(input: string, info: string): string;

in between calculate_mac and calculate_mac_long_kdf

This revision now requires changes to proceed.Mar 9 2023, 1:46 PM

I pulled this from the version of the types in node_modules. Will try to make those improvements, with exceptions for any methods that might not exist in this older version of Olm (I think you're looking at master, which I linked above)

keyserver/flow-typed/npm/@matrix-org/olm_vx.x.x.js
17–19 ↗(On Diff #23593)

Ran these commands to confirm that this doesn't exist on our version of Olm (3.2.4):

cd web/node_modules/\@matrix-org/olm/
grep -R unpublished_fallback_key .                                                                                                                                                                                                                                                                                        grep -R forget_old_fallback_key .

I'm a little worried about using a different versions of Olm in different parts of our app. It's ultimately unavoidable (ie. if we upgrade keyserver and native at the same time, we'll still have some old clients running the old version), but it seems like a good idea to keep our versions generally in sync.

The latest version of Olm is actually 3.2.14, so arguably we should just upgrade everything. I think @anunay has been working off of master, as I recall him mentioning forget_old_fallback_key.

I'll try to put up a diff ahead of this one that upgrades our versions of Olm.

Update to 3.2.14; respond to review

This revision is now accepted and ready to land.Mar 11 2023, 10:32 AM