Commit ceafcf1
committed
RPC: Fix getObject() using wrong baseline for receiving diffs
getObject() used localObjects as the diff baseline when receiving from
the remote peer. But the remote computes diffs against the last synced
state (remoteObjects), not the local state. When the local side modifies
a tree (e.g., via a local recipe) before calling getObject(), the two
baselines diverge, producing a hybrid tree that corrupts remoteObjects
and causes subsequent transfers to fail with IndexError/desync.
Fix: use remoteObjects (the last synced state) as the baseline, matching
what the remote peer uses. Python's get_object_from_java() already did
this correctly; Java and TypeScript had the same bug.1 parent 886de26 commit ceafcf1
2 files changed
Lines changed: 12 additions & 5 deletions
File tree
- rewrite-core/src/main/java/org/openrewrite/rpc
- rewrite-javascript/rewrite/src/rpc
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
465 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
466 | 469 | | |
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
473 | | - | |
| 476 | + | |
474 | 477 | | |
475 | 478 | | |
476 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
| |||
133 | 137 | | |
134 | 138 | | |
135 | 139 | | |
136 | | - | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
0 commit comments