"Sync completed" is a problematic term... the Datastore API is continually syncing. You can use DbxDatastoreStatus
to see if there are any known changes currently in flight. When you first link an account, the isDownloading
field should be true, so you could use that to gate on the "first sync."
As for your use case of adding initial data, you might want to instead use getOrInsert
with a known ID (like "metadata"). That way even if the record is created on multiple devices, you'll still end up with only one record.