On Tue, Nov 30, 2021 at 06:44:14PM -0500, Peng Bai via isync-devel wrote:
if a message was previously synced
and then marked `\Deleted` and expunged, this trick will not re-sync it but
instead gives a warning:
~~~
pair (4749,2358)
Notice: conflicting changes in (4749,2358)

you get this notice when you change the message on *both* sides, in different ways. i suppose you might have marked the message as deleted on both sides and expunged it only on the near side.

arguably, it's a bit stupid to print the notice when executing the sync operation would actually result in the same change. you can try the attached patch if you feel like it.

 not pushing delete

that means that you explicitly omitted deletion pushing from the sync operations.

My use case is that I want to review messages
on the far side that are marked `\Deleted` (by some automatic process) and
may un-`\Deleted` some of them, but I do want to delete and expunge
messages on the near side for those that are completely deleted on the far
side. I'm having some difficulty in devising a scheme to make this work.

you could first do a pull with expunge, then (for the time being) hack the state file (a simple sed script should do), and then do a pull without expunge. then you'd do the manual review, and finally push (flags and deletions).

of course, a cleaner process would be the automaton marking these messages with $Junk instead, but unfortunately mbsync doesn't support syncing keywords, and you might have trouble comfortably editing them on the near side anyway (the lack of a maildir standard for that is the actual problem).
>From 041f48061d701ff1fdf8709c75f8e99e28d9b265 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <o...@users.sf.net>
Date: Wed, 1 Dec 2021 11:25:06 +0100
Subject: [PATCH] don't complain about concurrent flagging as deleted

the result of propagating a deletion is flagging as deleted, so shut up
if the only remote change is exactly that.
---
 src/sync.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/sync.c b/src/sync.c
index 0fd5d89..67ce5aa 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -1696,7 +1696,11 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux
 						JLOG( "> %u %u 0", (srec->uid[F], srec->uid[N]), "near side expired, orphaning far side" );
 						srec->uid[N] = 0;
 					} else {
-						if (srec->msg[t] && (srec->msg[t]->status & M_FLAGS) && srec->msg[t]->flags != srec->flags)
+						if (srec->msg[t] && (srec->msg[t]->status & M_FLAGS) &&
+						    // Ignore deleted flag, as that's what we'll change ourselves ...
+						    (((srec->msg[t]->flags & ~F_DELETED) != (srec->flags & ~F_DELETED)) ||
+						     // ... except for undeletion, as that's the opposite.
+						     (!(srec->msg[t]->flags & F_DELETED) && (srec->flags & F_DELETED))))
 							notice( "Notice: conflicting changes in (%u,%u)\n", srec->uid[F], srec->uid[N] );
 						if (svars->chan->ops[t] & OP_DELETE) {
 							debug( "  %sing delete\n", str_hl[t] );
-- 
2.33.1.11.g2e4d00c830

_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to