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
F2032775: D7068.id.diff
Tue, Jun 18, 3:35 AM
Unknown Object (File)
Wed, Jun 12, 3:06 PM
Unknown Object (File)
Wed, Jun 12, 8:41 AM
Unknown Object (File)
Mon, Jun 3, 1:06 AM
Unknown Object (File)
Sun, Jun 2, 11:25 AM
Unknown Object (File)
Thu, May 30, 11:41 AM
Unknown Object (File)
Thu, May 30, 11:41 AM
Unknown Object (File)
Thu, May 30, 11:41 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

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

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

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.