-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
xftp: add sending and receiving via URI-encoded redirects #968
Conversation
src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20240124_file_redirect.hs
Show resolved
Hide resolved
ALTER TABLE snd_files ADD COLUMN redirect_size INTEGER; | ||
ALTER TABLE snd_files ADD COLUMN redirect_digest BLOB; | ||
|
||
ALTER TABLE rcv_files ADD COLUMN redirect_id INTEGER REFERENCES rcv_files ON DELETE CASCADE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are temporary and unencrypted redirect descriptions files deleted?
There are two cases:
- on cleanup - they may be deleted if are read from db first
- on delete api call
It may be better to explicitly check in both cases if file has a redirect file and delete in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also redirect file can be deleted after destination rcv file has been updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added received yaml deletion right after reading it.
Redirect records should be picked up by agent's clean up manager just like the ordinary files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redirect records will be transitively deleted in db due to ON DELETE CASCADE and will not be picked up by cleanup manager for file deletion.
For delete api record of the file itself is always deleted first and redirect record deleted transitively, so the problem is even more acute than with cleanup manager where order may differ.
* xftp: add URI encoding for FileDescription * tweak URI * allow smaller blocks * draft xftpReceiveFileFollow' and xftpSendFilePublic' * add sending with redirect * allow 64k chunks * add migrations with redirect fields * add test case * fix deadlock * revert CLI code * WIP: working send/receive via URI * fix field ambiguity * cleanup * update agent db schema * update minimal chunk size * add rfc * apply suggestions from code review Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com> * add createRcvFileRedirect * extract Simplex.Messaging.ServiceScheme and reuse for files * update db schema * check size/digest on receive complete * cleanup * use SIZE/DIGEST errors for redirects too * split digest/size errors from redirect checks * fix redirect error encoding * rename RedirectMeta to RedirectFileInfo * use query encoding for file URI * group maybe fields under RcvFileRedirect * add extras field * update rfc * add extras encoding and no-redirect tests * fix toStrict for old ghc * extra client data in file descr URI * remove decoded yaml file --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
No description provided.