Page MenuHomePhabricator

[keyserver][web] Use unique filename for each prod olm.wasm asset
ClosedPublic

Authored by ashoat on Mar 14 2023, 1:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 5:51 AM
Unknown Object (File)
Sun, Nov 24, 3:40 AM
Unknown Object (File)
Sun, Nov 24, 2:43 AM
Unknown Object (File)
Sun, Nov 24, 12:52 AM
Unknown Object (File)
Tue, Nov 19, 10:02 AM
Unknown Object (File)
Tue, Nov 19, 10:01 AM
Unknown Object (File)
Tue, Nov 19, 10:01 AM
Unknown Object (File)
Tue, Nov 19, 9:59 AM
Subscribers

Details

Summary

More context in ENG-3322. Basically we started seeing an issue after updating Olm where the old version was still in cache. This is "by design" – keyserver serves all prod assets as immutable to improve performance. For this to work, we need to make sure each prod asset has a unique filename.

Test Plan

Test both dev and prod, open up Chrome Dev Tools network tab (while web is logged out) and confirm olm.wasm was loaded correctly

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/olm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Get rid of line I accidentally left in

keyserver/src/responders/website-responders.js
100 ↗(On Diff #23737)

This empty string thing is a problem. I tried a bunch of things to get it to have a real string, but couldn't get it to work. It appears that:

Non chunk assets are lumped into an empty string key of the assets object

For now this is sorta okay, but it becomes a problem as soon as we add another WASM file that we need to copy in, which is basically happening right now with sql.js. More concretely, if we add the same AssetsPlugin to the webworkers Webpack config, it ends up "conflicting" with Olm, and only one of them can appear in the asset file.

As a result of this issue I'm investigating migrating to webpack-manifest-plugin, but for now I'd like to land this ASAP to address the live-in-prod caching issue.

web/webpack.config.cjs
51–60 ↗(On Diff #23737)

We continue using olm.wasm for dev, which is safe because we don't have the same caching behavior in dev

web/olm/olm-utils.js
11 ↗(On Diff #23737)

Docs on this in the README here

ashoat published this revision for review.Mar 14 2023, 2:08 PM

Will wait on docker keyserver build CI before landing

Would be good to quickly make sure login/SIWE on web continue to work as expected

This revision is now accepted and ready to land.Mar 14 2023, 2:09 PM

Works on dev. On prod I get invalid_parameters on the keyserver but I think that's because it's expecting web.comm.app

This revision was landed with ongoing or failed builds.Mar 14 2023, 2:15 PM
This revision was automatically updated to reflect the committed changes.