Page MenuHomePhabricator

[keyserver][landing] Fix reset preamble for landing SIWE
ClosedPublic

Authored by ashoat on Oct 24 2024, 7:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 7:38 AM
Unknown Object (File)
Thu, Nov 21, 1:59 PM
Unknown Object (File)
Thu, Nov 21, 12:51 PM
Unknown Object (File)
Thu, Nov 21, 8:10 AM
Unknown Object (File)
Fri, Nov 15, 2:28 AM
Unknown Object (File)
Tue, Nov 12, 2:09 PM
Unknown Object (File)
Sun, Nov 10, 11:22 PM
Unknown Object (File)
Sun, Nov 10, 11:09 PM
Subscribers

Details

Summary

To address incognito={true} not working on Android, in D6112 I introduced a "preamble" of sorts to landing that would reset localStorage.

Sometime since then this has stopped working (see ENG-9537). This diff makes two changes to bring it back:

  1. I had to move the preamble to a separate <script> tag in the returned HTML. I'm not sure why this was necessary, as my naive prior was that Webpack would execute the first lines of your entry first. But testing clearly revealed this to be necessary.
  2. I also had to add some lines to clear IndexedDB alongside localStorage.
Test Plan

I created a test environment on my personal server at https://comm.fund and then authorized comm.fund via WalletConnect's "Cloud" interface

I then deployed a dev build to my local device pointed at comm.fund/siwe. I confirmed that this worked by testing 10x times that swiping away SIWEPanel after initially connecting a wallet would result in a full reset the next time SIWEPanel was opened

I then tested the Android Zerion wallet workflow end-to-end

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable