You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(sdk): drop async on ingest verbs that never yield (#419)
* refactor(sdk): drop async on ingest verbs that never yield (#334)
Every ingest verb was `async fn` but the bodies were sync filesystem
walks and rusqlite writes — no `.await` actually reached the runtime.
Drop the `async` annotation so the type matches the semantics; callers
that need to run these from an async context can wrap them in
`tokio::task::spawn_blocking` (the sdk-node binding now does).
Also delete `run_ingest_tick` (a one-line wrapper over `ingest().await`)
and the dead `in_flight.lock().await` belt-and-braces in
`WatchController::stop` — the task handle await already covers any
in-flight tick.
CLI presenters that built a tokio runtime just to `block_on` ingest now
call the sync verb directly; only `burn ingest --watch` keeps its
runtime (the watch loop still spawns async tasks for the FS-event
driver).
https://claude.ai/code/session_01RAt76YyVgMYdij9zeqPUFB
* fix(sdk): restore in_flight barrier in WatchController::stop
Codex review on #419 flagged that dropping the trailing
`in_flight.lock().await` regresses the "await any in-flight tick"
contract: the public `tick()` path doesn't check the `stopped` flag, so
a concurrent caller can grab `in_flight` and run an ingest after the
loop task has already exited. Awaiting the spawned task handle alone
covers the runner-driven path but not that one — callers that tear down
state right after `stop().await` could race an active write.
Put the trailing `in_flight.lock().await` back and document why it
isn't redundant.
https://claude.ai/code/session_01RAt76YyVgMYdij9zeqPUFB
* docs(changelog): trim Unreleased ingest entry to impact-first bullet
CodeRabbit review feedback on #419: per the project's CLAUDE.md
guidelines, changelog entries should be concise and impact-first.
https://claude.ai/code/session_01RAt76YyVgMYdij9zeqPUFB
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments