Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iCloud sync not working #271

Open
webframp opened this issue Sep 17, 2020 · 17 comments
Open

iCloud sync not working #271

webframp opened this issue Sep 17, 2020 · 17 comments
Assignees
Labels
bug Categorizes issue or PR as related to a bug. sync Categorizes issue or PR as related to sync behaviors, dropbox, icloud, webdav, etc

Comments

@webframp
Copy link
Member

Reported by a user in https://gitter.im/MobileOrg/Lobby

Setup for iCloud sync should only be: Configure iCloud Sync in the mobile app, Initiate a sync to create the iCloud Drive folder, then configure emacs org-mobile-directory value to point to the path in your ~/Library/Mobile Documents folder

However when attempted a file name does not show in Outlines tab, but there is an empty line shown with an > indicator
And with "View item as a Document" there's just a (null) headline.

@webframp webframp added the bug Categorizes issue or PR as related to a bug. label Sep 17, 2020
@webframp
Copy link
Member Author

@dive since you worked mostly on this feature perhaps you have an idea where best to start debugging?

@chuxubank
Copy link

After restart the app, the empty lines disappeared and nothing shows up even I click the sync button.
BTY, the sync page (which shows "Syncing Org-files" and file names which are syncing) gone very quickly, while using WebDAV it takes a reasonable time to sync.

@ghost
Copy link

ghost commented Sep 18, 2020

Not working at all for me. iPhone 11 Pro Max, iOS 14. Can't use dropbox because it's blocked by corporate firewall. Suppose I can try setting up WebDAV on one of my Raspberry Pis.

@dive
Copy link
Member

dive commented Sep 19, 2020

@webframp, sure. I will take a look. So far, I see that the release version on AppStore does not create a proper directory in iCloud for some reason. Local builds and the last version from iTunes Connect work fine. Will investigate.

@dive dive self-assigned this Sep 19, 2020
@dive
Copy link
Member

dive commented Sep 19, 2020

Okay, there is definitely a problem with the initial sync but it works in general.

@chuxubank, @stevenbuehler, can you help us and confirm that

  • org-mobile configured properly on the Emacs side with the following line in your init.el
(setq org-mobile-directory "~/Library/Mobile Documents/iCloud~com~mobileorg~mobileorg/Documents")
  • you have initiated the initial synchronization with the org-mobile-push command from the Emacs. (Unfortunately, the initial sync has to be initiated from the Emacs (at least, for iCloud sync), and we do not handle well scenarios when a user wants to start the journey on the iOS side).

As the result, there will be MobileOrg directory in the iCloud storage. The easiest way to check is to open Files application on your device, go to "iCloud Drive" directory, open "MobileOrg" and check that all expected .org files are there.

P.S. @webframp, it seems that I forgot to update the documentation about iCloud sync on the user side 🤦

Thanks!

@chuxubank
Copy link

chuxubank commented Sep 19, 2020

@dive Thanks for your help and hard work!
As @webframp told me on Gitter, I got the org-mobile-directory in #246 and use Emacs to push files succefully.
Here's my MobileOrg directory in iCloud on Mac.
My macOS MobileOrg Directory

Here's my MobileOrg directory in iCloud on iOS

Seemed that the iOS MobileOrg app do not download the file even if I click the sync button.
I tried to download these files manually but there's no luck. The only difference is that the empty lines as I mentioned above showed up
Try to download ALL the files manually and it should work!

The strange empty lines The strange empty lines

@dive
Copy link
Member

dive commented Sep 19, 2020

@chuxubank, thank you! I see the problem on the iOS side. MobileOrg has to force iCloud Drive to sync all the files within the "MobileOrg" directory, but it is not the case on your screenshot from iOS (these cloud icons on the right-side of the list). It seems that I am able to reproduce it locally as well. Perhaps, something has changed in the iCloud logic or I missed something in the implementation. Anyway, I will try to debug it and prepare a fix.

Meanwhile, you can try to download all the files manually (you have to press the cloud icon for each of the files). This will resolve the problem and from this point it has to work as expected. It is crazy, I know 😞 , but there is no button "Sync the folder" in the Files application.

@chuxubank
Copy link

You are right, I have to download ALL the files manually, and it works now!
Thanks!

@dive dive added the sync Categorizes issue or PR as related to sync behaviors, dropbox, icloud, webdav, etc label Sep 19, 2020
@webframp
Copy link
Member Author

@dive I can add an update for the docs site today.

webframp added a commit to MobileOrg/mobileorg.github.io that referenced this issue Sep 19, 2020
Just adds basic docs to help users get started.

These can be improved after fixing the bug mentioned in:

MobileOrg/mobileorg#271
@webframp
Copy link
Member Author

@webframp, sure. I will take a look. So far, I see that the release version on AppStore does not create a proper directory in iCloud for some reason. Local builds and the last version from iTunes Connect work fine. Will investigate.

Can confirm I'm seeing the same behavior. Works locally when I test, but the released version has the bug.

@ghost
Copy link

ghost commented Sep 19, 2020 via email

@zellyn
Copy link

zellyn commented Sep 2, 2021

So, I started the sync from the app, which is apparently bad? I tried deleting the folder, and doing org-mobile-push from emacs, which re-created the folder, and added all my org files.

However, nothing at all shows up in the app. When I hit , I see a brief flash, almost too fast to see: I can barely read "Syncing Org-files" and then something smaller below. But the "Outlines" screen remains a blank screen full of lines.

Here's the weird thing: if I create a capture, and then sync, the capture will disappear forever from the mobile app. But a new file will show up in the iCloud folder, named mobileorg.org, mobileorg 2.org, etc. Those will not show up in my org dir if I do an org-mobile-pull or sync: emacs just says there are no new files.

Anyway, hope that helps… any help appreciated!

@zellyn
Copy link

zellyn commented Sep 2, 2021

Update: after reading #275, I deleted all the mobileorg.org files in the iCloud folder (in Finder: they were not showing up in dired 🤷), and now when I create a new capture, they end up in the same mobileorg.org file in my iCloud folder. But they still disappear completely from the app after syncing.

@webframp
Copy link
Member Author

webframp commented Sep 2, 2021

sorry to hear about the issues with iCloud sync @zellyn

@dive knows that feature the best, I still use Dropbox sync myself. Time has been limited lately for fixes, but we can try to take a look soon

@Borklex
Copy link

Borklex commented Jul 25, 2023

MobileOrg on iPhone will create a fresh capture file called mobileorg.org every time a capture or edit is pushed (pushing with neither new change won't do anything ). iCloud will regard this new file with the same name as a conflict and create a suffixed version called mobileorg.org(1) only on the receiving end. A second capture or edit with a push from iPhone will delete the conflicted file and the new one will appear as unconflicted at both ends.

A quick fix is to call a hook after (org-mobile-pull) to delete 'org-capture-file.

You still have to make two edits/captures and with a corresponding refresh for each to get rid of the conflict at the pc end though. Silly I know but it's to do with this issue :

https://developer.apple.com/library/archive/technotes/tn2336/_index.html

@Borklex
Copy link

Borklex commented Jul 25, 2023

Oh also - when 'org-mobile-push creates a fresh set of staging files at the iPhone end - for some reason I don't yet know - checksum.dat is the only file that won't download to the phone - as indicated by the cloud down arrow icon. Without tapping on this in the file viewer MobileOrg wont startup .

@webframp
Copy link
Member Author

Hey @Borklex thanks for the feedback. I'll look into this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug. sync Categorizes issue or PR as related to sync behaviors, dropbox, icloud, webdav, etc
Projects
None yet
Development

No branches or pull requests

5 participants