@@ -13,8 +13,6 @@ function disconnectedState() {
1313 mode : "disconnected" as const ,
1414 socket : null ,
1515 pendingRemoteChanges : [ ] ,
16- pendingOperations : new Map ( ) ,
17- nextOperationId : 1 ,
1816 }
1917}
2018
@@ -23,8 +21,6 @@ function watchingState() {
2321 mode : "watching" as const ,
2422 socket : mockSocket ,
2523 pendingRemoteChanges : [ ] ,
26- pendingOperations : new Map ( ) ,
27- nextOperationId : 1 ,
2824 }
2925}
3026
@@ -33,8 +29,6 @@ function handshakingState() {
3329 mode : "handshaking" as const ,
3430 socket : mockSocket ,
3531 pendingRemoteChanges : [ ] ,
36- pendingOperations : new Map ( ) ,
37- nextOperationId : 1 ,
3832 }
3933}
4034
@@ -43,8 +37,6 @@ function snapshotProcessingState() {
4337 mode : "snapshot_processing" as const ,
4438 socket : mockSocket ,
4539 pendingRemoteChanges : [ ] ,
46- pendingOperations : new Map ( ) ,
47- nextOperationId : 1 ,
4840 }
4941}
5042
@@ -64,8 +56,6 @@ function conflictResolutionState(
6456 socket : mockSocket ,
6557 pendingConflicts,
6658 pendingRemoteChanges : [ ] ,
67- pendingOperations : new Map ( ) ,
68- nextOperationId : 1 ,
6959 }
7060}
7161
@@ -249,16 +239,17 @@ describe("Code Link", () => {
249239 expect ( result . effects . some ( e => e . type === "WRITE_FILES" ) ) . toBe ( true )
250240 } )
251241
252- it ( "queues changes during initial sync" , ( ) => {
253- // Changes arriving during snapshot processing are queued, not applied immediately
242+ it ( "ignores changes during initial sync" , ( ) => {
243+ // Changes arriving during snapshot processing are ignored - snapshot handles reconciliation
254244 const state = snapshotProcessingState ( )
255245 const result = transition ( state , {
256246 type : "REMOTE_FILE_CHANGE" ,
257247 file : { name : "Button.tsx" , content : "late arrival" , modifiedAt : Date . now ( ) } ,
258248 } )
259249
260- expect ( result . state . pendingRemoteChanges ) . toHaveLength ( 1 )
250+ expect ( result . state . pendingRemoteChanges ) . toHaveLength ( 0 )
261251 expect ( result . effects . some ( e => e . type === "WRITE_FILES" ) ) . toBe ( false )
252+ expect ( result . effects . some ( e => e . type === "LOG" ) ) . toBe ( true )
262253 } )
263254
264255 it ( "creates new local file and uploads to Framer" , ( ) => {
0 commit comments