MobileOrg / mobileorg

MobileOrg iPhone App
http://mobileorg.github.io
GNU General Public License v2.0
557 stars 69 forks source link

Crashes if wrong encryption password is used during sync #177

Closed laurynas-biveinis closed 7 years ago

laurynas-biveinis commented 7 years ago

I have several large org files I'd like to sync with MobileOrg, using Dropbox.

In 1.7.1 from AppStore, a sync proceeds with several files, fills a progress bar for one of them, pauses, and quits the app.

In current git version running in a simulator, the same set of files results in sync stopped at an earlier file, and gives a "Bad file encoding", "Unable to detect file encoding, please re-save this file using UTF-8."

The error message did not say which file (or even if it was referring to the source .org file in the first place). I went through all my files with isutf8, and it pointed out several problems. I have fixed all of them and re-pushed, but 1.7.1 still crashes, and 1.7.2 still gives "Bad file encoding" error.

How do I proceed from here? Thanks

mgmart commented 7 years ago

That's bad. We should at least provide enough information in the error message.

Could you please check for utf8 in your staging area? Maybe the editsFile is the cause of the problem.

If that's not the case we have to dig further a bit.

laurynas-biveinis commented 7 years ago

I might be confused which dir I should look at - but the app directory in Dropbox does not have a file named editsFile, it only has checksums.dat in ASCII and the rest are encrypted binary files? Should I look somewhere else?

mgmart commented 7 years ago

Do you use file encryption?

laurynas-biveinis commented 7 years ago

Yes. Trying without...

laurynas-biveinis commented 7 years ago

OK! The results without encryption are: 1.7.1 crashes the same. 1.7.2 works

mgmart commented 7 years ago

The 1.7.1 crash could be caused by #174 although this has only happened with WebDAV so far. But maybe it's because of large files

laurynas-biveinis commented 7 years ago

The largest file in the 1.7.2 staging area, unencrypted, is 1.2MB

mgmart commented 7 years ago

That's big 😄

Could you make sure that the password you are using is correctly entered in MobileOrg's settings? Somehow a wrong or not set password results also in bad file encoding

laurynas-biveinis commented 7 years ago

All previous 1.7.2 tests, including encrypted file ones, have been with no password entered (I forgot that I'm using encryption)

Not sure what was the password status of 1.7.1 before, likely it was present and correct. It still crashes with it re-entered.

1.7.2 with correct password works correctly too

mgmart commented 7 years ago

Good to know. Regarding 1.7.1 we have some bugs fixed.

Sorry for the inconvenience. I'll investigate how we can signal that the password is missing.