deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
658 stars 84 forks source link

unzipping some .xdc is failing #3476

Closed r10s closed 2 years ago

r10s commented 2 years ago

on master, unzipping some .xdc files is failing with the error Encountered an unexpected header (actual: 0x0, expected: 0x6054b50).

eg. chess.xdc and tower-builder.xdc from https://webxdc.org have this issues, i've seen the issue also for "0h h1". probably there are more.

when receiving a new .xdc on master, these won't be recognized as such - if .xdc was received on core87 move, dc_msg_get_webxdc_info() will fail and name etc. is not displayed correctly and the webxdc won't start.

core87 does not have this issue, the mentioned .xdc all work there.

EDIT: maybe related to tokio, but more probably seems the zip update ...

dignifiedquire commented 2 years ago

We changed the library for doing zip operations, so I suspect the issue is that these are using now unsupported zip headers.

dignifiedquire commented 2 years ago

I'll take a look at what zip types these are

r10s commented 2 years ago

yeah, would be great if this is not related to tokio :)

r10s commented 2 years ago

i am currently writing a test with a failing .xdc

dignifiedquire commented 2 years ago

Tested locally and I can parse and unzip the manifest.toml with the library for both files

dignifiedquire commented 2 years ago

Do you have any additional trace back? can't find the source of this error at all? Also looked and the underlying deflate library didn't actually change.

r10s commented 2 years ago

i added a test, this one is failing for me on mac os 12.3.1 (repl, x86, rustc --version is 1.61) and also on ios (picks up rust-toolchain).

curious what ci will say :)

how can i get an additional trace back?

r10s commented 2 years ago

ci also fails as expected: https://github.com/deltachat/deltachat-core-rust/runs/7180859058?check_suite_focus=true#step:6:600

maybe there is sth. wrong with the features enabled? we need "deflate" and "store" algorithm, maybe the latter is disabled somehow? EDIT: seems to be fine. i tried over with default-features for rs-async-zip, this adds some crates with algorithms we do not need/want, but does not fix the issue.

dignifiedquire commented 2 years ago

Looks like the issue happens when writing, I suspect the file gets corrupted, as the original file works fine

r10s commented 2 years ago

Looks like the issue happens when writing, I suspect the file gets corrupted, as the original file works fine

not sure i understand correctly what you mean here. no one should write to the .xdc

however, i double checked, the chess.xdc from the test is binary equal to the one from webxdc.org and to the one i received a while ago on ios.

dignifiedquire commented 2 years ago

Found the issue, it has nothing to do with our code. This was a recent regression in async-zip: https://github.com/Majored/rs-async-zip/pull/27

r10s commented 2 years ago

wow, thanks for diving so deep 🤿