fix(azcosmos): remove no-op PopulateCompositeContinuationToken from ChangeFeedResponse#26792
Merged
tvaron3 merged 2 commits intoMay 15, 2026
Conversation
…hangeFeedResponse After PR Azure#26768, GetChangeFeed populates ChangeFeedResponse.ContinuationToken directly with the multi-range composite token. PopulateCompositeContinuationToken became a no-op (early-returning when ContinuationToken was already set) to prevent it from overwriting the multi-range token with a stale single-range one rebuilt from the per-head FeedRange. This PR removes the now-vestigial method outright. Tests that previously exercised it have been retargeted at GetCompositeContinuationToken (which still exists as a public helper for callers building single-range tokens manually). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the no-op PopulateCompositeContinuationToken() method from ChangeFeedResponse, which became redundant after the queue-driven GetChangeFeed rewrite in #26768 now populates ContinuationToken directly with multi-range composite tokens.
Changes:
- Deletes
PopulateCompositeContinuationToken()fromcosmos_change_feed_response.goand adds a Breaking Changes entry to the CHANGELOG. - Updates two existing tests to call
GetCompositeContinuationToken()instead. - Removes a stale comment referencing the deleted method.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sdk/data/azcosmos/cosmos_change_feed_response.go | Removes the deprecated no-op method. |
| sdk/data/azcosmos/cosmos_change_feed_response_test.go | Retargets tests at GetCompositeContinuationToken(). |
| sdk/data/azcosmos/cosmos_container_change_feed.go | Cleans up stale comment referencing removed method. |
| sdk/data/azcosmos/CHANGELOG.md | Documents the breaking change. |
simorenoh
reviewed
May 15, 2026
simorenoh
approved these changes
May 15, 2026
Co-authored-by: Simon Moreno <30335873+simorenoh@users.noreply.github.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.
Purpose
Removes
ChangeFeedResponse.PopulateCompositeContinuationToken(), which was made a no-op in PR #26768. With the queue-drivenGetChangeFeedrewrite, the response'sContinuationTokenfield is populated by the drain loop itself with a multi-range composite token. CallingPopulateCompositeContinuationToken()would either:main), orChangeFeedResponse, build a stale single-range token that would skip subsequent ranges after a split when used to resume.There's no remaining valid use case for the method, so this PR removes it outright.
Public API surface for getting continuation tokens after this change
ChangeFeedResponseexposes the following ways to obtain a continuation token, in order of preference:ContinuationToken string(struct field — recommended)Populated automatically by
GetChangeFeedwith the multi-range composite token that drives the queue-based drain loop introduced in fix(azcosmos): GetChangeFeed split-resilient via overlap match, 410/Gone retry, multi-range continuation queue (#26767) #26768. This is the only token shape that survives partition splits correctly. Pass it back viaChangeFeedOptions.Continuationto resume from where the previous call left off.GetCompositeContinuationToken() (string, error)Public helper that constructs a single-range composite token from the response's
FeedRange+ETag. Useful for advanced callers who hand-construct aChangeFeedResponseoutside the normalGetChangeFeedflow (e.g., test fixtures or custom adapters). Note: this builds a single-range token, so it will not preserve multi-range queue state across partition splits — prefer theContinuationTokenfield for production code.GetContinuation() stringLow-level accessor returning the raw
ETagstring from the response. Intended for callers that want to perform their own continuation-token construction; not directly usable as aChangeFeedOptions.Continuationvalue becauseGetChangeFeedonly honors composite-token JSON.GetContRanges() (min string, max string, ok bool)Low-level accessor returning the
FeedRangebounds of the page that was drained. Pairs withGetContinuation()for callers building tokens manually.What this PR changes
func (response *ChangeFeedResponse) PopulateCompositeContinuationToken()fromcosmos_change_feed_response.go.TestChangeFeedResponseWithFeedRange,TestChangeFeedResponseWithoutFeedRange) atGetCompositeContinuationToken()so the underlying composite-token construction stays covered.cosmos_container_change_feed.gothat referenced the deleted method.CHANGELOG.md.Tests
go test -race -short -count=1 ./sdk/data/azcosmos/...— all green.Checklist