Skip to content

fix: hook the array-root continuation path too, so the native cache completes - #682

Merged
KrX3D merged 1 commit into
mainfrom
fix/full-cache-array-path
Aug 29, 2026
Merged

fix: hook the array-root continuation path too, so the native cache completes#682
KrX3D merged 1 commit into
mainfrom
fix/full-cache-array-path

Conversation

@KrX3D

@KrX3D KrX3D commented Aug 29, 2026

Copy link
Copy Markdown
Owner

The accumulator from #681 never fired. With it live on-device, every continuation reaching the handler I hooked carried hasContinuation:true:

playlist.continuation.detected  itemCount:15  hasContinuation:true
playlist.continuation.detected  itemCount:15  hasContinuation:true
playlist.continuation.detected  itemCount:15  hasContinuation:true

15 initial + 45 = 60 of 68. The final batch — 8 items, no continuation token, the one completion depends on — never appeared there. It arrives through processResponsePayload, the array-root JSON.parse path, which handles playlistVideoListContinuation separately and logs nothing. So the accumulator sat at 45 items waiting for a completion that couldn't come, and the slow re-download stayed on the critical path:

20:05:03.141 .. 20:05:11.128   batch_fetched x4
20:05:11.131   full_cache.stored   (via the collector, ~10s in)

Same object-root/array-root split that has caught this file before. Hooked the array path too, before its filterContinuationItems call for the same reason as the other.

Also deduped the accumulator by video id, since two handlers now feed it and a response reaching both would put duplicate tiles in the cached playlist.

Expected next run: full_cache.from_native about a second in, then storedreloadinginjected, with batch_collect.cancelled instead of 8s of batch_fetched.

…ompletes

The accumulator added in the last PR never fired. On-device with it live,
every continuation reaching the handler I hooked carried
hasContinuation:true:

  playlist.continuation.detected  itemCount:15  hasContinuation:true
  playlist.continuation.detected  itemCount:15  hasContinuation:true
  playlist.continuation.detected  itemCount:15  hasContinuation:true

That is 15 initial + 45 = 60 of 68 items. The final batch — the 8 items
carrying no continuation token, the one completion depends on — never
appeared there at all. It arrives through processResponsePayload, the
array-root JSON.parse path, which handles playlistVideoListContinuation
separately and logs nothing. So the accumulator sat at 45 items waiting
for a completion that could not come, and the slow re-download stayed on
the critical path exactly as before:

  20:05:03.141 .. 20:05:11.128   batch_fetched x4
  20:05:11.131   full_cache.stored   (via the collector, ~10s in)

This is the same object-root/array-root split that has bitten this file
before, where a feature added to one path silently misses the other.

Hooked the array-root path as well, before its filterContinuationItems
call for the same reason as the other one — after it, an all-watched batch
is down to the single kept helper.

Also deduped the accumulator by video id. Two handlers now feed it, and a
response reaching both would otherwise put duplicate tiles in the cached
playlist.
@KrX3D
KrX3D merged commit 5a70739 into main Aug 29, 2026
3 checks passed
@KrX3D
KrX3D deleted the fix/full-cache-array-path branch August 29, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant