earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
624 stars 18 forks source link

Improve filesystem sync timestamp heuristic #246

Closed sgwilym closed 2 years ago

sgwilym commented 2 years ago

What's the problem you solved?

This fix addresses this sequence of events:

0000: (Remote) /@ownd/doc.txt set to A
0500: (FS local): /@ownd/doc.txt synced to fs as A
1000: (Remote) @/ownd/doc.txt set to B
2000: (FS Local) doc.txt touched by fs (still A), mtime updated.
3000: Sync attempted - fails due to old value.

What solution are you recommending?

The solution was to only update sync manifest entries' modified time properties if the content hash has changed since last time.