Skip to content

Fix crash when EPUB CSS cache missing + avoid repeated cover thumb generation #761

@DChells

Description

@DChells

Summary

Two related UX/stability issues on ESP32-C3 when working with EPUBs:

  • Reader can crash-loop when css_rules.cache is missing and we attempt on-demand CSS parsing.
  • Home can periodically pause because it keeps retrying cover thumbnail generation when the EPUB cover JPEG is unsupported.

Tracking fix in #762.

Details

1) Reader crash loop on CSS cache miss

  • Missing: /.crosspoint/epub_<hash>/css_rules.cache
  • We attempt to parse CSS on-demand.
  • On large books / tight heap this can throw/abort → reboot loop.

2) Home "Loading..." pauses from repeated thumbnail retries

  • Home tries to generate thumb_<height>.bmp for recent books.
  • Progressive JPEG covers fail in picojpeg with error 37 (PJPG_UNSUPPORTED_MODE).
  • Without a thumb, Home keeps retrying on later renders, causing visible pauses.

Repro (high level)

  • Delete/miss css_rules.cache for a large EPUB, open it in Reader → crash loop.
  • Use an EPUB with a progressive JPEG cover, go to Home repeatedly → repeated thumb attempts.

Expected

  • Reader should fail open (continue without CSS) instead of abort/reboot.
  • Home should not repeatedly retry thumbnail generation for unsupported covers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcrashConditions that cause crosspoint to crashreaderRelated to the core reader experience

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions