OPDS Downloads Failing

My first test went great! Bulk import of 109 comics no issue.

You removed a checksum?

Vandor

Amazing, that’s great to read @Vandor :raised_hands: .

You removed a checksum?

Not at all. We re-implemented it using different APIs.


For those interested in technical details:

Until now, we have been using the open-source library Checksum to calculate them.
Looking at the implementation Checksum/Extensions.swift at develop · rnine/Checksum · GitHub, we noticed that, even though checksums are returned synchronously, it uses DispatchGroups that internally use thread locks.
This is unnecessary in our use case because we already have our own thread model and can wait for long-lasting tasks if needed.

I assume that those thread locks are causing deadlocks on some devices.
On top of that, Checksum uses CommonCrypto, an open-source cryptographic library by Apple that has been deprecated in favor of a more modern CryptoKit library.

We used Checksum for a long time because CommonCrypto is not very ergonomic in Swift, and we preferred using an open-source wrapper that many people would use, to make sure our usage of CommonCrypto was correct and safe. CommonCrypto provides a C API which is more finicky in terms of memory management and things like that.

The last build we released today contains our own implementation for calculating the file checksums using CryptoKit, which provides a nice Swift API.
Our new implementation doesn’t use thread locks; hopefully :crossed_fingers: works the problem around.


I will wait for @Clay 's feedback before assuming this issue is fixed. But it makes sense and matches what I saw in one of Clay’s logs. :pray: :crossed_fingers::crossed_fingers:

Awesome - thanks for the info!

1 Like

BY JOVE I THINK YOU’VE GOT IT

pulled 2 separate 20+ downloads. no problems.

THANK YOU

YES !!!

I’m glad it works now! Thank you so much for the cooperation and patience :pray:

1 Like