Deduplicate Worker Deployments within a "single" Page#11110
Open
Shivs11 wants to merge 4 commits into
Open
Conversation
Shivs11
marked this pull request as ready for review
July 16, 2026 14:55
- Rename workerDeploymentSummariesFromVisibilityPage -> collapseDuplicateDeploymentSummaries to lead with the dedup intent. - Use a pointer-valued map so the winning record is mutated in place, removing the value-copy write-back footgun. - Add flow comments explaining why duplicate RUNNING records exist (immediate CaN + eventually-consistent Visibility), why we key on deployment name and tiebreak on raw execution start time, and how the slot index preserves first-occurrence ordering. - Rename the three tests to be behavior-first and add nolint directives for the v0.31 GetCurrentVersion deprecation (matching workflow.go). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
Worker Deployment creation can immediately Continue-As-New, and delete-and-recreate starts another run with the same deployment identity. Because Visibility updates are eventually consistent, the successor start can be visible before the predecessor close update.
ListWorkerDeploymentspreviously converted every returned execution into a summary, so overlapping running records in the same Visibility page appeared as duplicate deployments.This change post-processes only the fetched page. It does not add cross-page state or alter Worker Deployment workflow behavior.
Testing
Note
Low Risk
Read-path-only change to list summarization with bounded per-page logic; deployment workflow behavior and pagination contracts are unchanged.
Overview
ListWorkerDeploymentsno longer emits one summary per Visibility row when the same deployment appears multiple times on a page (e.g. Continue-As-New or delete/recreate while Visibility is eventually consistent).After each Visibility fetch, results are post-processed by
collapseDuplicateDeploymentSummaries: rows are keyed by deployment name, the run with the latest execution start time wins, and the output keeps the first-seen slot ordering for that page. Next-page tokens are unchanged; dedup does not span pages.Unit tests mock Visibility to cover newest-run wins (including memo-not-yet-written), mixed deployments on one page, and duplicates split across pages.
Reviewed by Cursor Bugbot for commit 093a07b. Bugbot is set up for automated code reviews on this repo. Configure here.