open-trackers / DcaltUI

UI Layer for Daily Calorie Tracker
Mozilla Public License 2.0
0 stars 0 forks source link

Sync bug #14

Open reedes opened 1 year ago

reedes commented 1 year ago

Data for today can be lost if other device adds entry prior to syncing.

Temporary workaround: ensure sync for day on second device completes prior to adding entry. Alternatively stick with one device.

Investigating a fix.

An attempt to reproduce:

(1) Ensure that DCT+ app isn't running on phone. Disable internet (5G, wifi, etc). There should have been no data for 'today' created or synced to iCloud from phone.

(2) On watch running DCT for new 'today' make first entry (eg, coffee drink for 110 cal); be on wi-fi internet so that iCloud sync occurs

(3) Start up DCT+ on phone, still offline, and make first 'today' entry (eg, burrito for 500 cal); enable internet so that iCloud sync occurs

(4) Verify that both entries are present; if not, you've reproduced the bug!

reedes commented 1 year ago

I'll be looking at the recently-announced SwiftData framework as an alternative, which may provide a better way to deal with these syncing issues.