client-core: one phase-correct helper for opening a stream #235
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!235
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-199"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A stream id is positional on the wire: the daemon accepts an opening request only when its
stream_idis exactly thenext unopened one, so opening a stream means allocating that id, applying the phase transition the opener needs, and
stamping the
stream_idenvelope, in that order with nothing in between. Three CLI call sites re-derived the sequencewith the ordering rule repeated as a comment beside each — the shape where a future opener goes out with no envelope, or
leaves an id issued for a frame that never goes out, which the daemon answers by ending the connection.
felis-client-corenow owns it:begin_streamissues the id plus theSetup→Observingtransition an observer'sNotify::Subscribeneeds, andopen_streamwrites the opener under it with nothing in between.Connection::open_streamand
Connection::subscribe_notificationsare the attached and observer entry points forfelis sessions capture,felis sessions search, andfelis notifications subscribe; thefelis bridgelink, which must register a receiverbetween the allocation and the write, hands that registration to the same helper as a callback and loses its separate
becoming_observerstep. A single genericConnection::open_streamcould not serve all three: the observer transitionis
Setup-only while the region and search streams open fromAttached, and the bridge multiplexes one connectionacross concurrent tasks, so the phase is an argument and the caller's between-the-locks work a callback.
Tests: three unit tests in
felis-client-corepin the id order fromAttached(1, 2, 3, each stamped on its ownopener), the observer's open from
Setup(id 1, driver leftObserving,Notify::Subscribecorrelated by stream id),and that an unsendable body issues no id. A source guard in
felis-clifails if any CLI source hand-rollsdriver.open_stream()orCorrelation::stream(again. No wire, CLI, or config change, so no CHANGELOG;docs/reference/ipc.md"Opening a stream" names the helper.The GUI client's search open (
felis-client'scommit_search_query) is left alone: it has noFrameWriterat hand andsends through the outgoing queue, so it shares no sequence with these three.
Fixes #199