Skip to content

K2GO-507 feat(contentexchange): export via prepare/poll/fetch long op - #692

Merged
luisguzman-adfa merged 3 commits into
mainfrom
feat/K2GO-507-app-export-longop
Oct 24, 2026
Merged

luisguzman-adfa merged 3 commits into
mainfrom
feat/K2GO-507-app-export-longop

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Follows the cx-core export long operation (K2GO-507). Replaces the single blocking
GET /v1/export/item with prepare -> poll status -> fetch, so a large Kolibri channel
that the box stages before streaming no longer times out.

  • ContentExportService.stage() prepares an item and polls status; the poll feeds the
    prepare half of the per-item bar and is the liveness signal (no wall-clock
    timeout). It tolerates transient poll blips and re-prepares once on a swept op.
  • stage() owns the box op until it hands a ready one to the fetch: a finally aborts
    the op on any abnormal exit, so an abandoned stage does not keep running on the
    box until the TTL sweep.
  • The fetch stream uses a per-read stall timeout (an inactivity gap), not a wall
    clock, so a multi-GB stream is fine as long as bytes keep flowing.
  • Two-phase per-item progress: prepare 0..50 from staged bytes, write 50..100 from
    copied bytes.

UI changes:

  • New string "Preparing %1$s..." (k2go_cx_export_item_preparing_fmt): the item label
    shown during the staging half of the bar. Light and dark verified on the on-device
    export run.

Replace the single blocking export-item request (20 s read timeout) with a
long operation: prepare, poll status, fetch. A large staged item (a multi-GB
Kolibri channel) no longer times out because the poll is the liveness signal
and the fetch uses a per-read stall timeout, not a wall clock. The per-item
progress bar becomes two-phase (prepare 0..50 from stagedBytes, write 50..100
from copiedBytes). Cancel aborts the in-flight op; a swept op (status 404)
re-prepares once; transient status blips are tolerated before an item fails.
…tage() exit

stage() now owns the box op until it hands a ready one to the fetch: a finally
aborts the current op on cancel, box error, poll-budget exhaustion or worker
interrupt, so a live multi-GB stage is not left running until the box TTL sweep.
@luisguzman-adfa luisguzman-adfa added the ui change or edit to UI label Oct 23, 2026
Migrate k2go_cx_export_item_preparing_fmt ("Preparing %1$s...") and the
leftover k2go_cx_export_category_fmt ("%1$s: %2$d%%") from the WIP tracker
into strings.xml with all 33 locale values (machine, flagged for review;
the category label is format-only, so the copies are identical). Clears
both from strings_untranslated.xml.
@luisguzman-adfa luisguzman-adfa added the strings changes or updates on xml strings files label Oct 23, 2026
@luisguzman-adfa
luisguzman-adfa merged commit 6ef9312 into main Oct 24, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-507-app-export-longop branch October 24, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

strings changes or updates on xml strings files ui change or edit to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant