Skip to content

K2GO-577 feat(share): resume a cut ZIM share and close the session on Done - #783

Closed
luisguzman-adfa wants to merge 3 commits into
mainfrom
feat/K2GO-577-share-resume-close
Closed

luisguzman-adfa wants to merge 3 commits into
mainfrom
feat/K2GO-577-share-resume-close

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What changes

  • dash-node 1.6.3: the /v1 relay forwards X-Share-Token to conex-core (never logged).
  • conex-core 0.3.6: the share fetch accepts Range: bytes=N- for a direct item (ZIM) and answers 206 with Content-Range. The Kiwix import checks the ZIM's own MD5 while it copies and replaces the target only on a match (code corrupt otherwise).
  • APK: the receiver keeps a cut item as a partial keyed by its exact-build id (ZIM UUID) and resumes it with Range on Retry. It keeps a partial only when the sender marks the body as the exact file (Accept-Ranges: bytes). Rules in contentexchange/domain/PartialPayload (JVM tests).

Why

  • Retry restarted a cut item at byte 0, so a large ZIM started over.
  • The sender's close got 401 in the relay, so the old share code stayed valid up to 6 h after Done.

Steps to QA

  • Baseline: share a ZIM, cut the receiver mid-item, press Retry: it restarts at 0. Press Done on the sender: the old code still returns the manifest.
  • Change: same steps. Retry continues from the cut byte (206) and the imported ZIM hash matches the sender. After Done the old code gets 404.

Verifications

  • OnePlus 7T, baseline then change: results and logs in K2GO-577 (Jira comment).
  • conex-core tests (227), dash-node relay tests + tsc, app JVM unit tests: pass.
  • Two-pass review done (partial file and import temp lifecycle).
  • Deferred: Kolibri and Calibre (tar bodies) still restart at 0. A generic resume belongs in the export-op layer: one fixed artifact per session plus a sha256 in the manifest.
  • Deferred: Cancel could warn that the kept progress is lost (needs a new translated string).

Notes

  • Partial lifecycle: kept on a transfer cut; removed on an ingest failure, on Cancel, or by the next import run that does not include the item. Finish keeps it, so a new share of the same ZIM resumes.
  • Open: after a link loss without a TCP reset, single-flight keeps the item busy until the sender's write times out, so Retry can wait on 409.

The sender's close DELETE lost its token in the relay and got 401, so the
share stayed open after Done.
…ZIM MD5 on import

Retry of a cut share item restarted at byte 0. A resumed file must not
reach the library unless its own checksum matches.
The receiver keeps a cut exact-file item as a partial keyed by its ZIM UUID
and continues it with Range, so a large item does not restart at 0.
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