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
test(dispatcher): guard tenant-stream msg IDs against drift (#4547)
* test(dispatcher): guard tenant-stream msg IDs against drift
The pub/sub split (#4480) made the implicit durable-send mirror to tenant
streams an explicit allowlist (msgqueue.tenantStreamMsgIDs), which nearly
dropped task-cancelled on the API cancellation path during review. Nothing
kept that allowlist in sync with what the dispatcher's streams consume.
Make the dispatcher the checkable source of truth: msgsToWorkflowEvent's
switch becomes a lookup in a package-level workflowEventConverters map and
isMatchingWorkflowRunV1's switch a lookup in workflowRunMatchers, preserving
behavior. msgqueue exports the allowlist via TenantStreamMsgIDs(), and
TestTenantStreamMsgIDsInSync asserts set equality between the two, with
failure messages saying exactly what to update on either side.
* refactor(dispatcher): extract tenant-stream event handling into its own file
Move workflowEventConverters, workflowRunMatchers, msgsToWorkflowEvent and
isMatchingWorkflowRunV1 out of server.go into tenant_stream_events.go, next
to the drift test that asserts their keys against msgqueue's allowlist.
Collapse the repeated decode/loop/append scaffolding into two small generic
adapters (eventConverter, runMatcher), so each map entry is just its payload
type and field mapping; the workflow-run-finished status switch stays inside
its closure. Drop the unused DispatcherImpl receivers from both functions.
No behavior change: map misses and empty match results return exactly what
they did before.
0 commit comments