You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The draft becomes corrupted and get_draft never succeeds until the .xdc attachment is removed from it, or the draft itself is removed.
Additionally, misc_send_draft also fails with anyhow: .../....xdc is not a valid webxdc file.
Steps to reproduce the problem
Create an empty file.
Rename it to foo.xdc.
Open the messenger client
Attach the said file. Don't sent the message.
Switch to another chat.
Switch back to the original chat.
You'll see that the composer is disabled, because the code does not expect that getDraft fails.
Screenshots
Logs
Uncaught (in promise)
{code: -1, message: 'unable to locate the end of central directory record'}
Promise.then
(anonymous) @ Composer.tsx:764
(anonymous) @ Composer.tsx:797
I'm not sure whether to consider this JSON-RPC-specific, since misc_send_draft also fails.
but this is only based on file extension, and not on whether the .xdc file is actually valid.
I think we have to options here:
In set_draft, check the validity of the file prior to setting Viewtype::Webxdc.
Handle the fact that Viewtype::Webxdc messages can still have an invalid .xdc file, i.e. that get_webxdc_info can fail.
The latter seems more sensible to me, because this is similar to having an invalid image file: we'd just want to say "this is supposed to be an image, but we couldn't display it".
Expected behavior
get_draft
worksActual behavior
The draft becomes corrupted and
get_draft
never succeeds until the.xdc
attachment is removed from it, or the draft itself is removed.Additionally,
misc_send_draft
also fails withanyhow: .../....xdc is not a valid webxdc file
.Steps to reproduce the problem
foo.xdc
.You'll see that the composer is disabled, because the code does not expect that
getDraft
fails.Screenshots
Logs
I'm not sure whether to consider this JSON-RPC-specific, since
misc_send_draft
also fails.core/deltachat-jsonrpc/src/api.rs
Lines 2150 to 2158 in 1db9b77
I believe the error happens here
core/deltachat-jsonrpc/src/api/types/message.rs
Lines 145 to 149 in 21010f4
The
Viewtype
itWebxdc
because it gets set herecore/src/chat.rs
Lines 927 to 937 in ef798cd
but this is only based on file extension, and not on whether the
.xdc
file is actually valid.I think we have to options here:
set_draft
, check the validity of the file prior to settingViewtype::Webxdc
.Viewtype::Webxdc
messages can still have an invalid.xdc
file, i.e. thatget_webxdc_info
can fail.The latter seems more sensible to me, because this is similar to having an invalid image file: we'd just want to say "this is supposed to be an image, but we couldn't display it".
Related:
fetch_url
: return err on non 2xx reponses #6814 - which fixes an issue with drafting invalid.xdc
files. However, attaching an invalid.xdc
file manually from file system is still possible.The text was updated successfully, but these errors were encountered: