api!(jsonrpc): remove webxdc info from MessageObject #6920
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Message.get_webxdc_info()
may fail if the .xdc attachment is invalid, e.g. if it is not a ZIP file. Calling it while loading MessageObject resulted in a problem #6826 with loading the message that has Webxdc viewtype, but no valid .xdc attachment. The problem is worked around since #6866 (commit 81a6afd) by logging the error and ignoring it, but no error is returned to the JSON-RPC method caller.I now want to modify the logging macros to depend on a
tracing
crate which may not be imported by other crates such as deltachat-jsonrpc (#6919), so to avoid exposing this to the caller I am making thelog
module private (#6918). If we keep the workaround with logging the error and ignoring it, it should be moved into thedeltachat
crate as aMessage.get_webxdc_info_or_log_err()
variant that ignores errors and then make another variant ofWebxdcMessageInfo::get_for_message
that ignores errors as well.We don't ignore errors anywhere else, so a proper solution seems to move loading that may fail into a separate call so JSON-RPC calls can make it when Webxdc viewtype is detected and handle the error themselves. JSON-RPC method
get_webxdc_info
for this even exists already.