Skip to content

feat: support resume for mainframe ZIP downloads - #12

Draft
asimtahir-karakus-kd wants to merge 2 commits into
nextfrom
copilot/support-resume-mainframe-zip-downloads
Draft

feat: support resume for mainframe ZIP downloads#12
asimtahir-karakus-kd wants to merge 2 commits into
nextfrom
copilot/support-resume-mainframe-zip-downloads

Conversation

@asimtahir-karakus-kd

Copy link
Copy Markdown
Collaborator

Large mainframe ZIP downloads had no resume capability — any interruption required a full re-download from scratch.

Changes

lib/commands/serve/streempublic.js

  • Partial file detection — checks fs.existsSync / fs.statSync on the destination before starting; captures existingBytes
  • Range request — sends Range: bytes=N- header when existingBytes > 0; uses plain http.get otherwise
  • Append mode — opens write stream with flags: 'a' when resuming so existing data is preserved
  • HTTP 206 — confirms server support; seeds downloadedBytes with resumeFrom so progress bar reflects true overall completion from the first chunk
  • HTTP 200 fallback — if the server ignores the Range header, warns and restarts a clean download after deleting the partial file
  • HTTP 416 — treats Range Not Satisfiable as "already complete" and resolves immediately
  • Resume message — prints Resuming MainFrame Xpublic Zip download from byte N... when continuing an interrupted download
  • fs.unlink callbacks — all unlink calls now include error-handling callbacks for consistency
// Partial file detected → sends Range header, appends to file
const makeRequest = (callback) => resumeFrom > 0
    ? http.get(url, { headers: { 'Range': `bytes=${resumeFrom}-` } }, callback)
    : http.get(url, callback);

// Progress bar accounts for already-downloaded bytes
const totalBytes = isResuming ? resumeFrom + responseBytes : responseBytes;
let downloadedBytes = isResuming ? resumeFrom : 0;

Copilot AI and others added 2 commits April 17, 2026 07:57
Agent-Logs-Url: https://github.com/kocdigital/sf-cli-service/sessions/aecd9d2b-0aa2-4e6a-b073-fc35209906b5

Co-authored-by: asimtahir-karakus-kd <209095940+asimtahir-karakus-kd@users.noreply.github.com>
@asimtahir-karakus-kd asimtahir-karakus-kd self-assigned this Jul 17, 2026
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.

2 participants