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

Allow linking pictures in notes #92

Open
X-Ryl669 opened this issue Apr 17, 2021 · 6 comments
Open

Allow linking pictures in notes #92

X-Ryl669 opened this issue Apr 17, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@X-Ryl669
Copy link

It would be very useful if the application allowed importing a photo from the current gallery to insert in note (and even better, a small audio clip for recorded voice note)

@martinstoeckli martinstoeckli self-assigned this Apr 18, 2021
@martinstoeckli martinstoeckli added the enhancement New feature or request label Apr 18, 2021
@martinstoeckli
Copy link
Owner

This would be a nice feature and it is occasionally requested. It is well possible that support of attachements will be implemented in future, but let me explain why it is not so easy to do. It's a bit technical but nevertheless it should give some insight into the problems, a simple app like SilentNotes has to face.

Centralized apps which store the notes on their own servers, with server side code under their own control, can easily handle transactions. If a synchronization fails, a database can rollback all changes (notes and attachements) and get back to a valid state. If several devices sync at the same time, the transaction guarantees a serialization of the syncs.

SilentNotes on the other hand uses self hosting with WebDav, FTP or cloud services like OneDrive. There is no need to install code on server side, the server is not controlled by the app, and the protocols do not offer transaction handling. This makes it difficult to guarantee a valid state without loss of information.

Another problem is the clean-up of attachements when not used anymore. SilentNotes can only find out whether attachements are abandoned, as long as the safe is open and the content is decrypted (not at the moment of syncing). If you delete an encrypted note, SilentNotes cannot easily detect whether there is an attachement to remove, and other devices could still refer to it. For notes this is solved by maintaining a list of ids of all deleted notes.

That said, it is not impossible to implement, but I hope you understand why it needs some time.

@X-Ryl669
Copy link
Author

What about using data-url ? That way, there's no separate file to save and as such, no complex synchronization handling. It's using 33% more size for base64 encoding, but I don't think it's an issue.

@martinstoeckli
Copy link
Owner

martinstoeckli commented Apr 19, 2021

Yes including the pictures inside the repository (which is zipped before the encryption/sync anyway) would clearly solve the synchronisation problem, but it doesn't scale. With a few pictures you will quickly get up to 10MB, which can become a problem if you have to download it every time you startup the app. Even more of a problem is the upload, in case there are modifications on the notes, especially with a mobile data connection it would get slower and slower.

For me this is not an option, it is simply not necessary to up-/download the attachements every time, especially since they are immutable and never change. On the other hand, a proper handling must be possible and I will head for it.

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

What if you cache the photos on the phone, and only update them if they change. Would that be feasable? Is there any estimation for tjis feature? The app has great potential, but it's missing this important feature.

@martinstoeckli
Copy link
Owner

martinstoeckli commented May 20, 2022

SilentNotes always has a local copy of the notes/attachements, this is how the app works (one can work offline without internet connection). So this caching of encrypted attachements would be done in any case, the crucial point is whether a transaction has to handle multiple or a single file, cached attachements means that multiple files are involved.

At the moment I'm working hard at replacing the editor with ProseMirror , it allows for more features and it seems to run more stable. This is much of work and has priority at the moment, thus I cannot promise any date yet.

@martinstoeckli martinstoeckli pinned this issue Oct 8, 2022
@martinstoeckli
Copy link
Owner

martinstoeckli commented Mar 17, 2023

I'm currently extracting the synchronization into a background service, which can stay alive a bit longer than the app itself on Android. This is a precondition of a reliable synchronization of multiple files. https://github.com/martinstoeckli/SilentNotes/tree/feature/sync-background-service2

@martinstoeckli martinstoeckli unpinned this issue Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants