dedis / popstellar

Proof-of-personhood System
GNU Affero General Public License v3.0
35 stars 8 forks source link

[BUG] Very Quick Ghost UI Flashing When Switching Tabs #1927

Open Kaz-ookid opened 4 months ago

Kaz-ookid commented 4 months ago

Description (Actual behavior)

Let's say we enter a tab that has a UI changing depending on the validity of the user's token. We will call UI1 the UI that should show when the user has no valid token, and UI2 the one that shows when the user has a valid token.

When entering one of those tabs (example : Tokens), while having a valid token, we can see the UI1 flashing VERY quickly before seeing the actual meant UI, UI2.

Expected behavior

UI2 should not flash at all. If the user has a valid token, it should directly have the right UI setup.

How to reproduce

  1. Create a LAO, Join it with another device, create a RollCall, Scan your second device and close the RollCall
  2. On any device, open the Tokens tab (you may already have experienced a flash)
  3. Click on the available Token
  4. Wait a few seconds, then use the back arrow (top left corner)
  5. Experience a flash.
Front-ends:
Back-ends:

Impact

Minor user experience impact.

Possible root cause

When starting a fragment that has shifting UI depending on if the user has a Token or not, the valid token retrieval is too slow. Thus, the UI shows the default setup before changing to the right one.

Maybe have a globally stored variable for the validity of the token, rather than retrieving it at every fragment opening. Maybe also, do not display the UI before the retrieval of the token has been "done".

Screenshots

Start in a Token fragment: image

Use Back Arrow, see this UI flash VERY quickly: image

Then see the right UI: image