Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-no-consumer-log-shape-handle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@core/sync-service': patch
---

Emit `shape_handle` as Logger metadata (instead of interpolating it into the message body) for the "No consumer process when waiting on initial snapshot creation" error. This keeps the message text static so Sentry can deduplicate these events properly during incidents.
3 changes: 2 additions & 1 deletion packages/sync-service/lib/electric/shape_cache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ defmodule Electric.ShapeCache do
])

Logger.error(
"No consumer process when waiting on initial snapshot creation for #{shape_handle}"
"No consumer process when waiting on initial snapshot creation",
shape_handle: shape_handle
)

{:error, :unknown}
Expand Down
2 changes: 1 addition & 1 deletion packages/sync-service/test/electric/shape_cache_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ defmodule Electric.ShapeCacheTest do

assert String.contains?(
log,
"[error] No consumer process when waiting on initial snapshot creation for #{shape_handle}"
"shape_handle=#{shape_handle} [error] No consumer process when waiting on initial snapshot creation"
)

assert_receive {ShapeCache.ShapeCleaner, :cleanup, ^shape_handle}
Expand Down
Loading