Skip to content

Fix spurious seqno increment when a merge adopts an incoming config - #132

Open
jagerman wants to merge 1 commit into
session-foundation:devfrom
jagerman:config-merge-adopt
Open

Fix spurious seqno increment when a merge adopts an incoming config#132
jagerman wants to merge 1 commit into
session-foundation:devfrom
jagerman:config-merge-adopt

Conversation

@jagerman

Copy link
Copy Markdown
Member

When _merge runs while dirty it builds the result as a MutableConfigMessage, whose multi-config constructor unconditionally increments the seqno when nothing needed merging. That is correct when the surviving config is our own (and is unwound by the existing nothing-to-do branch), but when the survivor is an incoming message -- reachable while dirty via an exact (seqno, hash) duplicate (another device pushed the identical change) or via lagged-diff containment of such a duplicate -- we adopted it at the inflated seqno.

That burned a seqno no stored message occupies, so the peer's next ordinary change (correctly landing on the value we consumed) looked like a conflict and produced a pointless conflict-resolution push, and it eroded the config_lags() conflict window.

Adopt the incoming message at its own seqno instead, exactly as a non-dirty merge would; the merged (conflict-resolution) path is untouched.

When _merge runs while dirty it builds the result as a
MutableConfigMessage, whose multi-config constructor unconditionally
increments the seqno when nothing needed merging.  That is correct when
the surviving config is our own (and is unwound by the existing
nothing-to-do branch), but when the survivor is an *incoming* message --
reachable while dirty via an exact (seqno, hash) duplicate (another
device pushed the identical change) or via lagged-diff containment of
such a duplicate -- we adopted it at the inflated seqno.

That burned a seqno no stored message occupies, so the peer's next
ordinary change (correctly landing on the value we consumed) looked like
a conflict and produced a pointless conflict-resolution push, and it
eroded the config_lags() conflict window.

Adopt the incoming message at its own seqno instead, exactly as a
non-dirty merge would; the merged (conflict-resolution) path is
untouched.
@jagerman
jagerman force-pushed the config-merge-adopt branch from b664a9d to ba569b2 Compare August 20, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant