I have a bunch of XXX comments in here on some weirdnesses that turned up that weren't directly relevant to the rabbit I was chasing. If you have thoughts on those I'd love to hear them, but otherwise I'll probably kick them down the road for now so I can get back to other things.
I think I also want these to check modseq before/after setting \Seen to make sure it's only bumped once, because the PR that "fixes" the issue may double bump it, and that wouldn't be good.
Two commits here: one is a new regression test for https://github.com/cyrusimap/cyrus-imapd/issues/3240 / https://github.com/cyrusimap/cyrus-imapd/pull/3577, the other adds similar hardening to the tests that already existed.
I have a bunch of XXX comments in here on some weirdnesses that turned up that weren't directly relevant to the rabbit I was chasing. If you have thoughts on those I'd love to hear them, but otherwise I'll probably kick them down the road for now so I can get back to other things.