Skip to content

Conversation

@link2xt
Copy link
Collaborator

@link2xt link2xt commented Jun 16, 2025

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 the log module private (#6918). If we keep the workaround with logging the error and ignoring it, it should be moved into the deltachat crate as a Message.get_webxdc_info_or_log_err() variant that ignores errors and then make another variant of WebxdcMessageInfo::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.

@link2xt link2xt marked this pull request as draft June 16, 2025 03:41
@link2xt link2xt force-pushed the link2xt/message-object-no-webxdc-info branch from f198888 to 2394394 Compare June 16, 2025 03:42
@link2xt link2xt requested review from Hocuri, Simon-Laux and WofWca June 16, 2025 03:56
@link2xt link2xt self-assigned this Jun 16, 2025
@link2xt link2xt marked this pull request as ready for review June 16, 2025 03:57
Copy link
Collaborator

@WofWca WofWca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll re-state that this will require modifications to clients' code (Desktop, namely).
I have not assessed exactly what modifications will need to be made.
But I think this is a more correct approach.

@link2xt link2xt merged commit 07ce319 into main Jun 18, 2025
29 checks passed
@link2xt link2xt deleted the link2xt/message-object-no-webxdc-info branch June 18, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants