Skip to content

feat: httpStream - #2841

Open
RohitKushvaha01 wants to merge 4 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:feat/system-http-stream
Open

feat: httpStream#2841
RohitKushvaha01 wants to merge 4 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:feat/system-http-stream

Conversation

@RohitKushvaha01

@RohitKushvaha01 RohitKushvaha01 commented Aug 31, 2026

Copy link
Copy Markdown
Member

Closes #2827

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a Cordova-backed streaming HTTP API that exposes native response data through a WHATWG ReadableStream.

  • Adds Android request streaming, cancellation, pause/resume backpressure, timeout handling, redirects, headers, and request bodies.
  • Aligns the JavaScript API, TypeScript declarations, Cordova manifest, and native service actions.
  • Adds unit coverage for incremental delivery, metadata, errors, cancellation, concurrent requests, and backpressure.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
src/plugins/system/android/com/foxdebug/system/StreamHttp.java Implements bounded native HTTP streaming with lifecycle cleanup, cancellation, backpressure controls, and terminal event handling.
src/plugins/system/android/com/foxdebug/system/System.java Registers the new streaming actions and cancels active requests during plugin reset or destruction.
src/plugins/system/www/plugin.js Maps native stream events into a WHATWG Response and ReadableStream while propagating cancellation and backpressure.
src/plugins/system/system.d.ts Declares the streaming request options and Promise API.
tests/unit/systemHttpStream.test.js Covers the principal JavaScript streaming contract with an incremental local HTTP bridge.
src/plugins/system/plugin.xml Registers the native source and Android internet permission.

Sequence Diagram

sequenceDiagram
    participant Caller as JavaScript caller
    participant API as system.httpStream
    participant Cordova as Cordova bridge
    participant Native as StreamHttp
    participant Server as HTTP server
    Caller->>API: httpStream(url, options)
    API->>Cordova: http-stream-start
    Cordova->>Native: Start request with request ID
    Native->>Server: Open HttpURLConnection
    Server-->>Native: Headers and response bytes
    Native-->>API: headers event
    API-->>Caller: Resolve Response
    loop Response chunks
        Native-->>API: Base64 data event
        API-->>Caller: Uint8Array chunk
    end
    API->>Native: pause/resume on backpressure
    Caller->>API: Cancel reader
    API->>Native: http-stream-cancel
    Native-->>API: complete or error
Loading

Reviews (4): Last reviewed commit: "fix" | Re-trigger Greptile

Comment thread src/plugins/system/android/com/foxdebug/system/StreamHttp.java
@RohitKushvaha01
RohitKushvaha01 marked this pull request as draft August 31, 2026 08:10
@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptile

Comment thread src/plugins/system/android/com/foxdebug/system/StreamHttp.java
@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptile

@RohitKushvaha01
RohitKushvaha01 marked this pull request as ready for review September 1, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Native HTTP: stream response bodies so plugins can consume SSE / fetch() ReadableStream

1 participant