farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
59 stars 38 forks source link

Files attached to logs get overwritten on sync #444

Closed mstenta closed 3 years ago

mstenta commented 3 years ago

Just discovered a serious bug in this thread: https://farmos.discourse.group/t/farm-input-file-nnnnnnnn-dat/803

When a log that has files attached to it is loaded into Field Kit, and then synced back to the server, all files get overwritten. The result is a set of 0 byte files with names like farm_activity_file_1621511950.dat.

Steps to reproduce:

  1. Create a new log in farmOS, attach a file to the "Files" field, assign to your user, and mark as "not done".
  2. Log into https://v1.farmos.app as your user, and pull in the log.
  3. Make an edit to the log (eg: add some notes), and sync it back to the server.
  4. Look at the log on the server. The file has been renamed and emptied.
jgaehring commented 3 years ago

Should be resolved by #445, closing.