terrychou / iVim

A vim port to iOS.
601 stars 34 forks source link

New version iVim 2.29 (5) broke opening an encrypted file #189

Closed DanielMontreal closed 3 years ago

DanielMontreal commented 3 years ago

Since this new version, opening an encrypted file from iCloud-Drive does not show the encryption dialog, instead it opens an empty file in vim.

The previous version was opening a dialog to ask for the password, then opened the file correctly decoded.

Thanks!

Daniel

terrychou commented 3 years ago

Thanks for the feedback!

What about other non-encrypted files? Can they be opened as expected this way? Which iOS version and device are you using?

DanielMontreal commented 3 years ago

Oups! Sorry, I feel like a beginner!

Non-encrypted files open normally, as expected. The bad behaviour is only with encrypted files.

Iphone 6s / IOS 14.4

Thanks

terrychou commented 3 years ago

I have made some related fixes in version 2.29(6) and pushed it to TestFlight. Let's see whether it solves this issue or not.

DanielMontreal commented 3 years ago

No it does not solve the problem. Same behaviour.

Made a little video of the screen capture. Usually when I click iVim to open the files, there is a dialog asking me for the password. Now, nothing.

https://user-images.githubusercontent.com/77865248/107880067-7c124580-6eaa-11eb-8fa0-2bf23d8a61bd.MP4

terrychou commented 3 years ago

After iVim is opened, what is the file name of the "empty" buffer? (Use ctrl+G to see)

Could you please try this: copy a encrypted file into iVim, then try to open it 1) with command ":edit"; 2) from the file browser?

DanielMontreal commented 3 years ago

ctrl-G shows: "[No Name]" --No lines in buffer

opening with command :edit (or :open) and the name of the file shows the old dialog to put the password with this: Warning: Using a weak encryption method; Enter encryption key: and if I enter the correct password, the file opens but everything is garbage like if there is no decryption at all (like when if wasn't working correctly last month).

if I open from the file browser of the file already on the iphone: it opens an empty file and the ctrl-G shows: "[No Name]" --No lines in buffer

Thanks

terrychou commented 3 years ago

By "file browser", I mean the newly added "file browser" view (":h ivim-file-browser"), rather than the iOS's Files.app. Use ":ibrowse -w" to open one.

Then it looks like the password input prompt is not showing on your iPhone. Maybe it has something to do with the way iPhones work with the multiple windows mechanism...

DanielMontreal commented 3 years ago

":ibrowse -w" does not work at all, but ":ibrowse" does open a browser to choose files. With that method, it works perfectly: it shows the password dialog (like previous sub-version) and it opens the file correctly (decoded).

All other methods fail. So I will use this method for the moment until the other works.

terrychou commented 3 years ago

I've pushed version 2.29(7) to TestFlight. I made some other attempts to "possibly" deal with this issue, please give it a try.

The problem right now is that, I don't have an iPhone by hand. Therefore, I can only test it on iPads and in the iPhone simulators. However, I've never succeeded to re-produce this issue. As a result, all the attempts are based on my guesses.

DanielMontreal commented 3 years ago

I can do the tests that you need. I can even make a video of my screen.

The new version is worse than the previous. Same behaviour if I try to open the file like usually (from the icloud then opening ivim, see previous video). But now the :ibrowse way that was working before does not even work anymore. It shows me the password dialog for about half a second then closes it and opens a blank file.

what test you need me to do?

terrychou commented 3 years ago

Thank you. According to your feedback so far, I think I know what is wrong. But I just don't know where I should place the fix. No worry, those attempts didn't fail for nothing. They have been narrowing possible targets for me.

As to the new :ibrowse problem, I am sure what is wrong. I'll fix it.

I will do some more fixes and push the update to TestFlight soon. Please help test it.

DanielMontreal commented 3 years ago

IT WORKS! with the new version as of this morning, it works! opening the file either from the icloud or from the vim browser.

Minor glitch: from the vim brower (":ibrowse") the password window closes then it opens again. Here is the video of this behaviour if interested. THANKS it's great!

https://user-images.githubusercontent.com/77865248/108522809-320ad480-729b-11eb-8dbc-f601faafeff7.mov

terrychou commented 3 years ago

Great! Then I will publish it to the App Store after some more refinements.

I am also aware of the glitch, and I will improve it. By the way, the ":edit" problem the encrypted file has also been solved (actually in the last build).

DanielMontreal commented 3 years ago

The new version you 2.30(1) works perfectly now with the encrypted files. Not even a glitch!

Congratulations, you nailed it.

I tested it from the internal browser :ibrowse and also calling it from the file itself (from icloud).

Thanks for everything. Case closed I think.

If you need any more testing, I'm willing. Used vim all my professional life (since 1986). Best editor ever (I teach it also in my System administration class).

terrychou commented 3 years ago

Sure thing. Thanks for helping.

As a matter of fact, since I have added you into the testing group, you will receive every update for testing. Please let me know if you find any problem or have any suggestion.