Skip to content

fix(deps): update Effect to 3.22 and fix the new language-service errors - #399

Merged
GraemeF merged 4 commits into
mainfrom
fix/effect-3-update
Sep 30, 2026
Merged

GraemeF merged 4 commits into
mainfrom
fix/effect-3-update

Conversation

@GraemeF

@GraemeF GraemeF commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Takes Renovate's Effect 3 update from #388 and fixes what broke its build.

The newer Effect language service reports failing an Effect with a plain Error as a warning, and our tsc runs fail on it. Each such site now fails with a tagged error:

  • Timeouts use Cause.TimeoutException, and "expected a value" checks use Cause.NoSuchElementException.
  • The connection config layer reuses the existing ConnectionError.
  • The todo example and the docs validation script each get one small Data.TaggedError.
  • The todo example's ID parsers now return Schema's ParseError directly.

Public signatures are unchanged. The testing-contracts helpers still declare Error, and the changeset covers the new tags they fail with.

Postgres store fix. @effect/sql-pg 0.53 opens a new connection for its first LISTEN, where 0.49 reused a pooled one. That exposed a bug in our notification listener, which started LISTEN in the background and returned before it was active. Any event committed in that gap was lost, and the subscription tests failed in CI. listen and listenAll now wait until a probe notification sent to their own channel comes back. Every listener drops probe payloads. The probe goes through pg_notify, because the notify in @effect/sql-pg 0.53 sends a parameterised NOTIFY, which Postgres rejects. The two new tests in bridge.integration.test.ts fail against the old listener.

This also bumps @effect/language-service to 0.87.3. Once this merges, #388 can be closed.

@GraemeF
GraemeF force-pushed the fix/effect-3-update branch from db4e2b2 to 74697e8 Compare September 30, 2026 08:13
@sonarqubecloud

Copy link
Copy Markdown

@GraemeF
GraemeF marked this pull request as ready for review September 30, 2026 11:54
@GraemeF
GraemeF merged commit 00f21c7 into main Sep 30, 2026
2 checks passed
@GraemeF
GraemeF deleted the fix/effect-3-update branch September 30, 2026 11:54
GraemeF added a commit that referenced this pull request Sep 30, 2026
…n runs (#420)

The in-memory store lost an event appended after `subscribe` or
`subscribeAll` returned but before the returned stream started running.
The Postgres store had the same gap, fixed in #399.

The cause was `Stream.fromPubSub`, which subscribes to the PubSub only
when the stream runs. Per-stream `subscribe` also took its history
snapshot at subscribe time, so an event appended in the gap was in
neither the snapshot nor the live feed.

A live stream now takes its snapshot and subscribes to the PubSub when
it runs, both under the lock that `append` holds while it publishes. The
snapshot starts from the position recorded when `subscribe` was called.
`EventStore.subscribe` takes no `Scope`, so subscribing eagerly would
leave a subscription open for any stream the caller never runs. Doing
the work at run time avoids that without changing the public API.

The new tests subscribe, append, and only then run the stream. The
fork-based tests added to the Postgres store in #399 pass against the
old in-memory code, because the forked fiber subscribes before the
append publishes.
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