Enhance TODO list and improve ServeSession synchronization logic

- Updated the TODO list to clarify tasks related to auto-selection and one-shot synchronization, ensuring better tracking of issues.
- Introduced a new flag `__oneShotSyncDone` in `ServeSession` to manage synchronization state, preventing further message processing after a one-shot sync is completed.
- Improved the handling of incoming changes during the patch visualizer, ensuring user selections are appropriately managed.

These changes aim to streamline synchronization processes and enhance user experience during patch management.
This commit is contained in:
Joe 2026-03-01 06:50:38 -06:00
parent 63b0b031ff
commit 118c195e64
2 changed files with 18 additions and 8 deletions

View file

@ -326,17 +326,18 @@ We need to investigate Tree reconciliation, make sure it's parallel, etc.
I'd really like to just reconcile specific paths that were modified - but i'm not sure if that just defeats the purpose.. need to explore this topic later.
Worst case - we reconcile only on connect, but do so in mega-parallel
[auto select issue]
when you commit changes on git, it's considered unchanged. we should send like the last git hash too, like prior to head, too.
Also, we need to explore how VSCode deals with this. They seem to have ZERO issues.
Maybe we can have a mode to tie into the vscode file watcher ourselves? luau-lsp does this.
[yielding after sync]
there is some process that is making disconnecting after a one-shot sync completes take FOREVER if the server is yielding (usually from the reconciler)
- once the one-shot sync completes, it should not be waiting for additional things to come from the server. it just needs to kill the connection immediately. and go back to the main page.
[auto select issue]
when you commit changes on git, it's considered unchanged. we need send prior git hash too, like prior to head.
right now i believe we are calculating the hashes manually, we CAN use the git hash since our hash schema matches it 1:1.
this would be a nice optimization, too.
[one shot mode change]
new changes that come in / out during the review menu on the plugin is really disorienting.
we should just make it stop accepting new changes once it has the full patch ready and displayed to the user
any further changes should have to be done NEXT one-shot sync
new changes that come in / out during the pathc visualizer menu on the plugin is really disorienting.
if a new change comes in mid-visualizer syncing, we need to unselect the change completely - not even permitting auto selections or whatever the user had selected (ONLY if that specific file was changed, of course)
this applies to all sync mode which that GUI is being used
[syncback]
detect when the output file hash is the same, and dont write to it.

View file

@ -125,6 +125,7 @@ function ServeSession.new(options)
__confirmingPatch = nil,
__isConfirming = false, -- Explicit confirmation state flag for defense-in-depth
__applyingPatch = false, -- Set during reconciler patch application to suppress DescendantAdded
__oneShotSyncDone = false,
__connections = connections,
__precommitCallbacks = {},
__postcommitCallbacks = {},
@ -222,6 +223,10 @@ function ServeSession:__onWebSocketMessage(messagesPacket)
return
end
if self.__oneShotSyncDone then
return
end
Log.info("Received {} messages from Rojo server", #messagesPacket.messages)
-- Combine all messages into a single patch
@ -879,6 +884,10 @@ function ServeSession:__confirmAndApplyInitialPatch(catchUpPatch, serverInfo)
self:__applyPatch(pushPatch)
end
if Settings:get("oneShotSync") then
self.__oneShotSyncDone = true
end
-- Send pull items + stage requests to Rojo server
local hasPullChanges = self.__twoWaySync and not PatchSet.isEmpty(pullPatch)
local hasStageIds = #stageIds > 0