QField icon indicating copy to clipboard operation
QField copied to clipboard

QFieldSync updates timestamps every time it syncs

Open scottspine opened this issue 2 years ago • 0 comments

I want to put a timestamp on records collected or modified in QField. I do this by setting an expression now() and checking 'apply default value'

this gives the desired result if I copy the project from my device and open it in QGIS. However, if I use QFieldSync, the it behaves as though the sync is an 'update' and the timestamps are updated accordingly. I can understand that the sync is effectively updating the original data but this result is undesirable for me

Reproduction Steps:

  1. Create a geopackage or shapefile dataset with a 'timestamp' field
  2. In Attribute form settings, uncheck 'editable', set expression now() check 'apply default value'
  3. Sync to QField configuring the dataset for offline editing
  4. Open project on device and modify records or create new ones
  5. Copy project from device--> open in a new instance of QGIS--> open attribute table or export dataset to csv
  6. In a different instance of QGIS, sync the above project to QGIS-->open attribute table or export dataset to csv to observe differences in timestamps

Expected behavior:

QFieldSync leaves timestamps as they are

Observed behavior:

QFieldSync treats a sync is an 'update' and the timestamps are updated accordingly

Screenshots and GIFs

Screenshot_time21

Note the difference in timestamps from 'raw' Screenshot_raw

and synced data on the same project Screenshot_synced

.ods output of another similar project which was synced. Note the times Screenshot_syncedtimes

QField version: QField 1.9.6 QGIS 3.16.12-Hannover on Debian GNU/Linux 10 (buster) QField Sync 3.4.4

Additional information:

  • Problem started happening recently, didn't happen in an older version of QField: [No]
  • Problem can be reliably reproduced, doesn't happen randomly: [Yes]
  • Problem happens with all files and projects, not only some files or projects: [Yes]

scottspine avatar Oct 29 '21 14:10 scottspine