Commit 80b9d73
fix: correctly sync initially untracked local documents
Addresses the issue where newly created files, or existing files that
were opened for the first time while sync was running, did not
propagate their initial state to the peer correctly.
- The `update_doc_from_file` and `load_or_create_doc` routines now
detect and load the initial plaintext directly into the Automerge
`ObjType::Text` before emitting the first sync payload.
- Fixed the receiver side to automatically construct parent directories
and a dummy file stub when receiving a payload for a completely
unknown path before attempting to apply the CRDT data.
Co-authored-by: Keshav-writes-code <95571677+Keshav-writes-code@users.noreply.github.com>1 parent 412cf51 commit 80b9d73
3 files changed
Lines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
| 135 | + | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
45 | 42 | | |
46 | 43 | | |
0 commit comments