iOS Auto-Sync not working

Viewing 11 reply threads
  • Author
    Posts
  • December 23, 2019 at 11:25 PM #38878

    Chris Ju
    Participant

    Hello Brendan,
    hello everybody,

    does anyone have an idea, why auto-sync (with CouchDB) doesn’t work on iOS. I have always (on every start of Tap Forms) to turn it off and on to start auto-sync.

    Thanks!
    Chris

    December 24, 2019 at 5:29 AM #38886

    tonyt
    Participant

    Most days on ios I find TF stuck on sync sending and I have to close and reopen the file and it syncs straight away? Using iCloud….

    December 25, 2019 at 7:13 PM #38908

    Sam Moffatt
    Participant

    Autosync usually works for me though if something gets stuck I usually go to sync settings and do a sign out/sign in flow to reset the sync state. This might be your problem.

    I have seen some situations where the CouchDB server is rejecting the sync requests due to internal server errors in CouchDB itself. This has been rare for me but does derail sync from time to time. When that happens doing another change to the record sometimes unsticks the server and in other cases I’ve duplicated the record. Back when the attachment sync used to be problematic, I quite frequently would duplicate records to get sync unstuck. You can usually figure out what is stuck by looking for 500 errors in your CouchDB logs.

    iCloud Sync takes forever for my scale of workload and I generally avoid it except when I create a new document. The first thing I do with a new empty document is send it to iCloud so that it shows up on all of my devices, I then disable iCloud Sync and switch over to my own CouchDB server. This ensures that the document is available on all of my devices so that when I go to a new device, I can download the empty database, disable iCloud on it and pull the full document via CouchDB.

    December 26, 2019 at 1:56 AM #38922

    Chris Ju
    Participant

    if something gets stuck I usually go to sync settings and do a sign out/sign in flow to reset the sync state

    Yes, that is possible for me too, but the auto-sync function is supposed to eliminate the need for manual synchronization…

    Thanks!
    Chris

    December 26, 2019 at 2:34 AM #38925

    tonyt
    Participant

    +1 for me too.

    December 26, 2019 at 3:08 AM #38929

    Brendan
    Keymaster

    If you make a change or add a new record on your iOS device, go to the Fauxton interface where the list of databases is, then refresh the screen. Do you see the # of Docs column increase when you do that? I just tested it and for me it’s working. If I add a new record and make a change, I can see that column incrementing without me having to do anything on the Sync Settings screen such as signing out or in again, since I have Auto-Sync enabled.

    December 26, 2019 at 3:25 AM #38931

    Chris Ju
    Participant

    Yes, you’re right. But maybe it’s easy for you to change the code, that auto-sync starts (when opening the app on iOS-Devices) without adding a record. … because I often only want to check Information…

    Could it be, that auto-sync is prohibited, because the database is encrypted?

    Thanks!
    Chris

    December 26, 2019 at 3:42 AM #38934

    Brendan
    Keymaster

    No. Even if the database is encrypted, the data inside CouchDB is not. The connection to the CouchDB server on your own network may not be encrypted unless you’re using SSL and have setup the certificate correctly.

    So I just tested directly modifying a document in the Fauxton interface in CouchDB. I edited the name of a form. I had the document opened on my iPhone. A few moments after I changed the form name in the JSON of the document in Fauxton, the form name changed automatically on iOS. I didn’t have to do anything at all. That’s because I had auto-sync enabled. I didn’t have to sign-out and sign-in again. I also tried closing the document in Tap Forms first, then changing the form name in Fauxton, then opening the document in Tap Forms and moments after I opened the document in Tap Forms, it synced and got the updated form name.

    So I’m really not sure why it’s not syncing for you.

    If you close the document on iOS and re-open it, does it sync changes you made to the Mac version then?

    December 26, 2019 at 3:59 AM #38935

    Chris Ju
    Participant

    I tried it with encryption disabled and it is the same behaviour…

    To clarify: Auto-sync also works in all directions for me, but first I have to either create a new entry, change an entry or switch auto-sync off / on. But this is only necessary if the app has not been active on the iOS device for a certain time (maybe 5-10 minutes) …

    Maybe you can change the code, that on every start the app send an change to the database…

    But it is not such a big issue! I thought it is a bug!

    Thanks for your help!
    Chris

    Merry Christmas ;-) !

    December 27, 2019 at 1:31 AM #38953

    Sam Moffatt
    Participant

    For me every time I start TF, it starts syncing to my CouchDB instance without any changes required. I usually start up TF on my iOS devices and watch to see until they finish sync to make sure it’s fully consistent before making any changes. Once it’s caught up on all of the changes, it’ll generally sit there silently polling for changes or pushing new changes as they’re made. Depending on how far back a device is for a particular document that can take under a minute or up to ten minutes when I’m pulling tens of thousands of changes with attachments.

    December 28, 2019 at 4:13 PM #38998

    john cesta
    Participant

    last week I struggled with my new mac and my ipad. Couldn’t figure out why nothing was syncing. Finally looked at my iphone in the tools of TF and saw it was stuck on sync fetching.

    December 28, 2019 at 6:41 PM #39007

    Sam Moffatt
    Participant

    When you’re using CouchDB (and maybe the Peer-To-Peer), there should be a number included with the sync message that should slowly go up over time as it pulls records down. Do you see the number?

    On the desktop it’ll be at the bottom right with two timestamps for last uploaded and last downloaded (you’ll need to click on it to see the value).

    I have noticed if I have lots of attachments that sometimes it can take a moment even on the same network to pull down the changes but generally it slowly makes progress over time.

Viewing 11 reply threads

You must be logged in to reply to this topic.