Skip to content

Result chunk assembly errors are ignored by the client #29

@nficano

Description

@nficano

src/Arcp.Client/ArcpClient.fs calls assembler.Append(chunkSeq, data, enc, more) |> ignore when dispatching JobEventBody.ResultChunk. ChunkAssembler.Append returns Error for out-of-order chunks and can throw for invalid base64 data, but the dispatch path neither completes the job result with an error nor closes the event stream. A malformed or reordered chunk stream can therefore leave callers with a final job.result but no usable bytes from TryReadResultBytes, with no clear indication of the protocol violation.

Fix prompt: handle chunk assembly failures in dispatchJobEvent. When Append returns Error, remove the handle, complete the event channel, and complete ResultSetter with that ARCPError; when decoding base64 throws, catch FormatException inside ChunkAssembler.Append and return ARCPError.InvalidRequest instead of throwing through the receive loop. Add unit tests for out-of-order chunk sequences and invalid base64 chunks that assert handle.Result completes with an error and the event stream terminates predictably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:mediumMedium severity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions