Subject: [lemonade] QRESYNC CLOSE race condition

From: Timo Sirainen <[email-masked]>
Date: Sat, 15 Mar 2008 16:52:05 +0200

If CLOSE expunges messages it sends the new HIGHESTMODSEQ in the tagged
reply. I guess the intent is that client could cache it and avoid
resyncing the expunge later. But what if two clients do changes:

C1: 1 store 1 +flags.silent \deleted
S1: * 1 FETCH (modseq 1)
S1: 1 OK

C2: 2 store 2 +flags.silent \deleted
S2: * 2 FETCH (modseq 2)
S2: 2 OK
C2: 3 expunge
S2: * VANISHED 2
S2: 3 OK [HIGHESTMODSEQ 3]
C2: 4 store 3 flags.silent \seen
S2: * 3 FETCH (modseq 4)
S2: 4 OK

C1: 5 close
S1: 5 OK [HIGHESTMODSEQ 5]

Client 1 now missed that UID 2 was just expunged and 3 had its flag
changed. To avoid this the server would have to send instead:

C1: 5 close
S1: * VANISHED 2
S1: * 3 FETCH (FLAGS (\Seen) modseq 4)
S1: 5 OK [HIGHESTMODSEQ 5]

Or did I miss something?

It gets a bit tricky to handle this if the reply should contain
everything except the messages that were previously seen as \Deleted. So
I think I'd just make it always send VANISHED to all expunged messages.
_______________________________________________
lemonade mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/lemonade
Supplemental Web Site:
http://www.standardstrack.com/ietf/lemonade

---

From: Alexey Melnikov <[email-masked]>
Date: Sat, 15 Mar 2008 16:39:43 +0000

>S1: 5 OK [HIGHESTMODSEQ 5]
Your proposal seems correct. QRESYNCbis should include your example.