-
-
Notifications
You must be signed in to change notification settings - Fork 100
Fix(jsonrpc): Do not error on missign webxdc info #6866
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
Conversation
If it is a bugfix for the main branch, it's better to base it on main branch and not pgp-contacts branch. |
I thought at some point @Hocuri noted that it would reduce merge problems if we just keep this as temporary main branch. I'm not up to date about the current situation on core though. |
This was an idea of mine, but it's up to @link2xt to decide since he's the one who maintains the PGP-branch, and @link2xt said that he's fine with just maintaining it while we continue merging bug fixes into main. I guess features that interact with PGP-contacts should be implemented on top of PGP-contacts, but also here, if in doubt let's just ask @link2xt beforehand. |
I merge the main branch into pgp-contacts branch from time to time, it's not a problem. This way we can also release bugfixes before we merge pgp-contacts branch into main. I want to squash-merged PGP-branch eventually, so it should have only PGP-contacts related changes compared to main. |
dff076c
to
72614b0
Compare
@@ -124,6 +124,23 @@ async fn test_send_invalid_webxdc() -> Result<()> { | |||
Ok(()) | |||
} | |||
|
|||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | |||
async fn test_set_draft_invalid_webxdc() -> Result<()> { |
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.
The test is not actually failing when I revert the fix, seems not to reproduce the bug
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.
The bug is deltachat-json-rpc specific. I tried to replicate the issue in core first and left the test as an artifact.
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.
Is it realistic to reproduce the bug with a python test?
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.
Rather a jsonrpc test, but I think it's unnecessary for such a small thing
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.
Doesn't matter whether it's a Typescript JsonRPC or a Python JsonRPC test (in deltachat-rpc-client/tests/test_something.py
), both are testing mostly the same API.
BTW, to prevent confusion about which Python bindings are meant, at some point we should rename the deprecated CFFI Python bindings, which are currently in python/
, to python-deprecated
, and then rename deltachat-rpc-client
to python-rpc-client
(or similar).
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.
Assuming that you checked that the Typescript test fails without the fix, LGTM
Typescript test did not even pass |
automerge mistake; will create a fix pr |
When an invalid webxdc is set as draft, json-rpc's
get_draft
fails, becauseget_webxdc_info
which it calls, fails because the zip reader can not read a non-zip file. With this change, any error occurring inget_webxdc_info
is ignored and the None-variant is returned instead. I also added a test, that setting invalid xdcs is draft is fine core-wise and checked that the input field stays responsive when a fake.xdc produced like in #6826 is added to draftclose #6826