Skip to content
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

Publication might be too big to be sent through an Intent to the Navigator #247

Closed
mickael-menu opened this issue Jan 23, 2020 · 3 comments · Fixed by readium/r2-testapp-kotlin#303
Labels
enhancement New feature or request

Comments

@mickael-menu
Copy link
Member

Intent extra data is limited in size, but Publication is not. This can produce a TransactionTooLargeException for big publications when starting the Navigator's Activity.

The PR readium/r2-testapp-kotlin#285 attempts to fix this problem with a global variable in the Navigator, but this strategy has some issues described in the PR's comments.

Possible alternatives are raised in readium/r2-testapp-kotlin#285 (comment).

@mickael-menu
Copy link
Member Author

I think using Fragment instead of Activity, as described in this issue, would fix the problem.

With this solution, the test-app would be responsible to propagate how they see fit the Publication in their own navigator Activity (if they choose to have one). In the navigator, we would expose a FragmentFactory to do proper dependency injection and get the Publication, as well as any non-serializable objects we might need (e.g. DRMContext for LCP rights management).

@mickael-menu
Copy link
Member Author

@Bolling88 reported that the issue occurs with this book: https://www.gutenberg.org/ebooks/61253.epub

He's using the positionList feature which increases the problem because the whole list is serialized, thus increasing the size of Publication.

@mickael-menu
Copy link
Member Author

While the aforelinked PRs quickly fix the problem with an ad-hoc API, the proper way to fix that if we still need to expose an Activity in r2-navigator-kotlin could be to use an AppComponentFactory to inject the Publication object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant