ukwa / ukwa-pywb

GNU General Public License v3.0
11 stars 3 forks source link

Ensure openAs works in integration tests #118

Closed anjackson closed 9 months ago

anjackson commented 10 months ago

The way the client opens ePubs was recently changed: https://github.com/ukwa/ukwa-pywb/commit/4d323f170b1ad03859561490b2571db8c48caf52

because we use a ePub streamer that opens up the ZIP remotely, which makes accessing large ePubs (2GB) possible (https://github.com/ukwa/ukwa-services/blob/aa95df6854382e6b6e84edc697dcb4da2804ef9c/access/rrwb/docker-compose.yml#L190-L194).

with an NGINX rewrite used to enforce the doc-streamer as a proxy: https://github.com/ukwa/ukwa-services/blob/aa95df6854382e6b6e84edc697dcb4da2804ef9c/access/rrwb/nginx/conf.d/common.inc#L15C1-L19

But this breaks integration tests. See comments on #112 #114

Either, make the openAs mode configurable, or (and this would make everything more realistic) add the doc-streamer to the integration testing stack and use it during tests.

anjackson commented 9 months ago

Ah, never mind! Fixing the type is not required. There is custom logic that should do the right thing:

https://github.com/futurepress/epub.js/blob/f09089cf77c55427bfdac7e0a4fa130e373a19c8/src/book.js#L410

tw4l commented 9 months ago

Ah, never mind! Fixing the type is not required. There is custom logic that should do the right thing:

https://github.com/futurepress/epub.js/blob/f09089cf77c55427bfdac7e0a4fa130e373a19c8/src/book.js#L410

Nice catch!