This repository was archived by the owner on Dec 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix stale SyncSetDeltaPacket rejection by tracking actual change IDs #139
Open
Copilot
wants to merge
3
commits into
master
Choose a base branch
from
copilot/fix-stale-syncset-delta-packets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix stale SyncSetDeltaPacket handling for tab entries
Fix stale SyncSetDeltaPacket rejection by tracking actual change IDs
Dec 3, 2025
TheBjoRedCraft
approved these changes
Dec 3, 2025
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical bug where clients were rejecting all legitimate delta packets after receiving a batch sync. The root cause was using Long.MAX_VALUE as the change ID marker after batch synchronization, which made all subsequent incremental updates (with normal sequential change IDs like 123, 124, etc.) appear "stale" and get rejected.
Key Changes:
- Exposed
currentChangeIdproperty inSyncSetImplto access the internal change counter - Modified
ClientboundBatchSyncSetPacketprotocol fromPair<String, Set>toTriple<String, Set, Long>to include each set's actual change ID - Updated client-side
SyncRegistryImplto track actual server change IDs instead of usingLong.MAX_VALUE
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/sync/SyncSetImpl.kt |
Added currentChangeId property to expose the internal changeCounter value for protocol serialization |
surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/protocol/synchronizing/ClientboundBatchSyncSetPacket.kt |
Modified packet structure to include change IDs in batch sync data; updated serialization/deserialization to write and read the Long changeId after each set's data |
surf-cloud-core/surf-cloud-core-client/src/main/kotlin/dev/slne/surf/cloud/core/client/sync/SyncRegistryImpl.kt |
Changed applyBatchSyncSets to accept Triple with changeId and use the actual server change ID for staleness tracking |
Qodana for JVM542 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at qodana-support@jetbrains.com
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clients were rejecting all delta packets after batch sync because
lastChangeIdwas set toLong.MAX_VALUE, causing legitimate incremental updates (changeId 123, 124, etc.) to fail the staleness check.Changes
currentChangeIdproperty to read the internalchangeCounterPair<String, Set>toTriple<String, Set, Long>to include each set's current change ID in batch syncLong.MAX_VALUEBefore:
After:
Breaking Change
Protocol modification requires coordinated deployment of clients and servers.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repo.slne.dev/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx4G -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14.3-bin/cv11ve7ro1n3o1j4so8xd9n66/gradle-8.14.3/lib/gradle-daemon-main-8.14.3.jar(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.