Skip to content

fix: append session should also create-stream-on-append if configured#180

Merged
shikhar merged 1 commit intomainfrom
fix-csoa
Feb 6, 2026
Merged

fix: append session should also create-stream-on-append if configured#180
shikhar merged 1 commit intomainfrom
fix-csoa

Conversation

@shikhar
Copy link
Copy Markdown
Member

@shikhar shikhar commented Feb 6, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 6, 2026

Greptile Overview

Greptile Summary

Fixed append_session to honor the create_stream_on_append basin configuration, bringing it into parity with the regular append method. Previously, append_session called streamer_client() directly, which would fail with StreamNotFoundError when the stream didn't exist, even if the basin was configured to auto-create streams on append.

  • Changed lite/src/backend/append.rs:42-46 to use streamer_client_with_auto_create instead of streamer_client
  • Added comprehensive test test_append_session_auto_create_stream to verify the fix
  • Test confirms stream is created automatically and append succeeds when create_stream_on_append = true

This ensures consistent behavior between both append methods and matches user expectations for the auto-create feature.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is a straightforward bug fix that brings append_session into parity with append. The implementation correctly reuses the existing streamer_client_with_auto_create method with the same configuration check. The new test thoroughly validates the fix and follows existing test patterns.
  • No files require special attention

Important Files Changed

Filename Overview
lite/src/backend/append.rs Updated append_session to respect create_stream_on_append configuration, matching the behavior of the regular append method
lite/tests/backend/data_plane/append.rs Added test test_append_session_auto_create_stream to verify that append_session auto-creates streams when configured

Sequence Diagram

sequenceDiagram
    participant Client
    participant Backend
    participant StreamerClient
    participant Basin

    Client->>Backend: append_session(basin, stream, inputs)
    Backend->>Backend: streamer_client_with_auto_create()
    Backend->>Basin: get_basin_config()
    Basin-->>Backend: BasinConfig (create_stream_on_append)
    
    alt Stream exists
        Backend->>StreamerClient: get existing client
        StreamerClient-->>Backend: client
    else Stream not found AND create_stream_on_append = true
        Backend->>Backend: create_stream()
        Backend->>StreamerClient: get new client
        StreamerClient-->>Backend: client
    else Stream not found AND create_stream_on_append = false
        Backend-->>Client: StreamNotFoundError
    end
    
    Backend->>Backend: SessionHandle::new()
    Backend-->>Client: Stream<Result<AppendAck, AppendError>>
    
    loop for each input
        Client->>StreamerClient: append_permit(input)
        StreamerClient->>StreamerClient: submit_session()
        StreamerClient-->>Client: AppendAck
    end
Loading

@shikhar shikhar merged commit 7b80736 into main Feb 6, 2026
19 of 20 checks passed
@shikhar shikhar deleted the fix-csoa branch February 6, 2026 02:50
@github-actions github-actions bot mentioned this pull request Feb 6, 2026
shikhar pushed a commit that referenced this pull request Feb 6, 2026
## 🤖 New release

* `s2-lite`: 0.27.5 -> 0.28.0 (✓ API compatible changes)
* `s2-cli`: 0.27.5 -> 0.28.0

<details><summary><i><b>Changelog</b></i></summary><p>

## `s2-lite`

<blockquote>

## [0.28.0] - 2026-02-06

### Features

- [**breaking**] Delete-on-empty
([#158](#158))

### Bug Fixes

- Append session should also `create-stream-on-append` if configured
([#180](#180))

<!-- generated by git-cliff -->
</blockquote>

## `s2-cli`

<blockquote>

## [0.28.0] - 2026-02-06

### Miscellaneous Tasks

- Update Cargo.lock dependencies

<!-- generated by git-cliff -->
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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