securedrop-client icon indicating copy to clipboard operation
securedrop-client copied to clipboard

"inbound" metadata sync can race with any outbound operation

Open cfm opened this issue 3 years ago • 2 comments

Description

For example: Sending a new reply too quickly after invoking Delete All Files and Messages can cause the sent reply to disappear until the next sync.

Steps to Reproduce

  1. Log into the Client.
  2. Select a source with some conversation entries.
  3. Select Delete All Files and Messages.
  4. Immediately send a reply (foobar <Ctrl>-<Enter>).

Expected Behavior

Deletion proceeds, but the sent reply transitions smoothly from faded (pending) to fully visible (sent).

Actual Behavior

The sent reply appears, disappears with deletion, and then reappears on the next sync.

Comments

  • [ ] Check whether the sent reply disappears while pending, sent, or either

cfm avatar Dec 09 '22 00:12 cfm

I can sometimes produce a different version of the same problem without needing the "delete files and messages" part - it's the issue of anything happening right when a sync is being applied. (See "ghost sources/replies" https://github.com/freedomofpress/securedrop-client/issues/1465#issuecomment-1098609190, https://github.com/freedomofpress/securedrop-client/issues/858)

What I saw:

Sometimes sending a reply, the reply goes from Pending to gone (yikes!) and then reappears after the next sync. No deletion required.

It's hard to reproduce, but if the sync (that came from the server before the reply reached the sever, ego is stale) is being applied, and the client has had acknowledgment from the server indicating it received the reply request, the reply could briefly disappear from view (stale sync is applied) then reappear (updated sync is applied).

rocodes avatar Jul 11 '24 20:07 rocodes

Based on our discussion of this today, @rocodes, I've kept the original description but broadened the title to reflect the fact that the race is between the inbound contents of the MetadataSyncJob and any outbound operation. Sending replies and changing the starred state are just the outbound operations that the user (a) has directly initiated and (b) can observe flapping until the race resolves.

cfm avatar Jul 11 '24 23:07 cfm

Closing; we're focusing on addressing the many sync-related issues as part of the rewrite.

eloquence avatar Jul 09 '25 00:07 eloquence