Skip to content

Infinite scroll busy loop when reaching end of book causes UI freeze #3672

@tuomas2

Description

@tuomas2

Description

When scrolling to the end of a Bible book (e.g. Ecclesiastes 12:14), the infinite scroll logic enters a busy loop where requestMoreToEnd returns null (no more chapters) but the Vue.js side keeps requesting more content indefinitely.

This causes:

  • Main thread saturation from continuous JS bridge calls (~15ms per iteration)
  • UI appearing frozen/hung, especially on slower devices
  • Excessive battery drain

In the reported case, 1166 null responses were logged over 28 minutes on an Onyx Go103 e-ink reader.

Steps to reproduce

  1. Open any Bible book
  2. Navigate to the last chapter (e.g. Ecclesiastes 12)
  3. Scroll to the bottom of the chapter
  4. The app becomes unresponsive

Root cause

loadTextAtEnd() in infinite-scroll.ts calls itself recursively when needsMoreContent() returns true. The consecutiveEmptyLoads safety counter was local to processQueues() and reset on every recursive call, so the loop never terminated.

Fix

Added reachedEnd/reachedStart flags that persist across recursive calls and are reset on document change (passage navigation). Committed in d9ed120.

Device info

  • App version: 5.0.915
  • Device: Onyx Go103 (e-ink reader)
  • Android: 12 (SDK 32)

OSTicket: https://support.andbible.org/scp/tickets.php?id=3177

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions