Skip to content

PCDs added in multiple popups can be lost #1384

@artwyman

Description

@artwyman

If a user uses multiple "add PCD" popups, and closes them quickly, the resulting changes may not reach the server, and could be lost if they are clobbered by further changes.

Example steps to reproduce:

  • Open consumer-client -> Add Messages to the Passport
  • Click "prove and add a signature proof" with the message "1"
  • Pop-up opens. Don't click Prove yet.
  • Back in the consumer-client, click "prove and add a signature proof" again with message "2"
  • In Popup 1, Click Prove then quickly click Close.
  • In Popup 2, Click Prove then quickly click Close.
  • Go to main PCDPass client, reload page, and examine results. You'll probably have one but not both of the new signature proofs.

If I follow these same steps but pause for 2s before clicking Close, all the PCDs survive.

The underlying issue seems to be closing the window before the new PCD is uploaded to the server. The in-memory state is lost. The new PCD is saved to local storage quickly, which would help if the popup were the only tab on the device. Opening a new tab (or reloading in the steps above) will load from local storage. However, existing tabs don't load from local storage, and there's also no ability merge when loading/saving from local storage. There's also the broader issue that if a user never opens another tab on this device at all, that new PCD is stuck in limbo.

The right user-focused answer here is probably to make sure the prove screen can wait for upload to complete before showing the Close button. Changes which reach the server are safe, and will be subject to merge logic when they reach other devices/tabs. Local storage is currently structured like a backup for when the "app" is killed and reloaded, but doesn't have robust merge logic, and isn't guaranteed to ever reach other devices.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions