cryptee / web-client

Cryptee's web client source code for all platforms.
https://crypt.ee
Other
444 stars 22 forks source link

[Feature] Implement quick save feature on Android/iOS #166

Closed ghost closed 1 year ago

ghost commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I use Cryptee to log todo stuff on Android. When I add an entry to my list I exit and wipe the app from the app timeline, because it is no longer needed and I assume the text have been saved and/or synced (just how it would happen with most other notepad apps ). But the autosave did not happen yet in these cases (this would otherwise take ~5 seconds to happen automatically which is really long when we are talking aboout dynamic events and ease of use).

Describe the solution you'd like A clear and concise description of what you want to happen.

Additional context Add any other context or screenshots about the feature request here.

Also please make the save status indication (which is currently a colored line) a bit more visible.

johnozbay commented 1 year ago

Hi there!

I use Cryptpad to log todo stuff on Android.

Just to clarify — Are you referring to Cryptee? or Cryptpad? It's a whole different service / platform / company ...

allow caching non saved versions which persist after a webapp wipe and can then be later reopened and saved (dangerous and potentially not possible)

This is a security risk, and we cannot do this. When phones / laptops etc go to sleep browser's state is frozen and saved to disk, and doing this would open the pandoras box.

or do not wait to save documents or shorten the time it takes to save automatically

This we cannot do either, and it has to do with Cryptee's on-device encryption.
Unlike unencrypted services like Google Docs, our servers cannot see your documents. So we cannot do delta-saves / updates. i.e. on google docs, if you type

"This" " is" " a" " sentence"

Google Docs can save these words individually in delta-updates, then since their servers can see the contents of your documents, (and keystrokes) they can merge those 4 deltas into : "This is a sentence".

Because our servers can't see your documents, they can't merge deltas either. This means, when you save a doc, Cryptee has to encrypt and upload the entire document (and not just individual words etc)

And if we don't wait, like you mentioned, your device would try to encrypt and upload the entire document on each and every keystroke. So if you have a 5mb document, you're looking at encrypting and uploading 5mb for each keystroke in those 5mb. Even if you have 1000 characters (and some images) you're looking at 5000mb encrypted & uploaded just to save that one 5mb file.

In addition, on mobile, most operating systems and on-screen keyboards don't type keys one by one. They type entire words. I.e. when you start typing "cryp" and see the auto-correct boxes show up over your keyboard and press "cryptography" you don't see the letters "t" "o" "g" "r" "a" "p" "h" "y" appear individually. You see the whole word appear. Because your OS / keyboard deletes "cryp" at lightspeed by pressing backspace 4 times, then writes "cryptography" in lightspeed for you.

So the timeout works as a throttle. After a little bit of inactivity, Cryptee detects that no changes are being made, and triggers encrypt & save.


Possible Solutions

a) We can consider lowering this rate, but it could have a performance and data impact on a lot of users who may be slow typers.

b) We can consider adding in a separate save button somewhere like you mentioned, but it won't fit on most mobile devices' screens anywhere.

image

^ iPhone 8 / 10 / 11 / 12 all have the same width, and the top bar is already almost full with icons nearly crammed and not enough space to add a separate save button anywhere. We can I guess add this inside another menu, but then you're looking at multiple taps to save.


A pro tip, if you close the keyboard or tap outside the document Cryptee automatically starts the save process. You can do this by tapping on any one of the buttons on the top, closing the keyboard by tapping android's back button, or by swiping open the left sidebar etc. Cryptee will start the encrypt & upload (save) process right away.

While it's not exactly a solution to what you're asking for, it's the closest we can do with the limitations and requirements at hand right now.

Hoping all these make sense and help!

Best,

J

ghost commented 1 year ago

Yes sorry I was referring to Cryptee.

The explanations to my 2nd and 3rd solutions makes sense. The protip do solve the issue.