[Bug]: TypeScript binary downloads resolve JSON success envelopes as files or bytes

Aperta
#7,449 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@stefanielizeth73-art ci sta già lavorando.

Dal 11/11/2026.

  • #7452 di @stefanielizeth73-art — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
node.js, typescript

Direzione di ricerca

Inspect the TypeScript SDK’s exportOVPack(), backupOVPack() and downloadBytes() paths that call parseResponse<never>(); the issue does not name their source files or tests. Start by locating those methods and the binary response tests. Done means JSON success envelopes raise an SDK protocol error while JSON API errors and successful binary downloads retain their behavior; linked pull request #7452 is already open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Issue Origin

Reproduced through the built TypeScript SDK against a local HTTP fixture. The fixture supplies a JSON response; no deployed OpenViking server or model was used.

Bug Description

The TypeScript binary download paths call parseResponse<never>() when a response is JSON. That type argument disappears at runtime: a successful JSON envelope resolves to its result instead of rejecting the unexpected response.

This affects exportOVPack() / backupOVPack() (declared Promise<string>) and downloadBytes() (declared Promise<Uint8Array>). For example, HTTP 200 with Content-Type: application/json and {"status":"ok","result":{"message":"not binary data"}} makes all three methods resolve to the object. The pack methods leave the previous file intact but report a successful download without returning a file path.

Steps to Reproduce
  1. Have a local .ovpack containing known-good-backup.
  2. Serve the JSON envelope above from the pack export/backup endpoint.
  3. Call client.backupOVPack(output) or client.exportOVPack("resources/docs", output).
  4. Return the same response from /api/v1/content/download and call client.downloadBytes("resources/a.bin").
Expected Behavior

JSON API errors retain their existing error code and details. A JSON success envelope at a binary endpoint raises an SDK protocol error, preserving any existing pack. A successful binary response returns the documented file path or bytes.

Actual Behavior

All three methods resolve to {message: "not binary data"}. Neither a completed file download nor a byte result was produced.

Proposed Fix and Compatibility

Keep the current JSON/API-error classification. After its existing parser returns without an error, explicitly reject the unexpected response instead of returning its JSON result. Leave JSON endpoints, snapshot metadata responses and successful binary downloads unchanged. No new API options or dependencies are needed.

OpenViking Version

Current main 32de68480d36593648563f749d9af7a4a817489f, @openviking/sdk 0.1.0 source build.

Runtime / Operating System

Node.js 25.9.0, Windows 11. Python and model backends are not involved.

Additional Context

This complements #7058's JSON envelope shape validation and #7358's Python backup response handling. It concerns an object-shaped JSON success envelope and the TypeScript binary return contract. The investigation and local reproduction were completed with Codex assistance.

Lingua principale
Python
Stelle
41.8k
Fork
3.4k
Merge medio
19h 29m
PR unite (30g)
500

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di volcengine/OpenViking

Tutte le issue di volcengine/OpenViking

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.