fix: SDK compat for 3.59.0-preview.0 + fix latest-stable-windows CI failure#49
Draft
Copilot wants to merge 4 commits into
Draft
fix: SDK compat for 3.59.0-preview.0 + fix latest-stable-windows CI failure#49Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/lemonlion/CosmosDB.InMemoryEmulator/sessions/a860859e-ed0f-455a-9e91-8dd3b6321e36 Co-authored-by: lemonlion <8618373+lemonlion@users.noreply.github.com>
… failure Agent-Logs-Url: https://github.com/lemonlion/CosmosDB.InMemoryEmulator/sessions/a860859e-ed0f-455a-9e91-8dd3b6321e36 Co-authored-by: lemonlion <8618373+lemonlion@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix SDK compatibility break for Microsoft.Azure.Cosmos v3.58.0
fix: SDK compat for 3.59.0-preview.0 + fix latest-stable-windows CI failure
Apr 21, 2026
…dException Agent-Logs-Url: https://github.com/lemonlion/CosmosDB.InMemoryEmulator/sessions/10ecf0ad-82a5-4c10-8865-83e847777836 Co-authored-by: lemonlion <8618373+lemonlion@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.
Two CI matrix failures:
latest-stable-windowscrashed due to a PowerShell-incompatible multi-linedotnet addcommand, andlatest-preview(3.59.0-preview.0) failed to build because the preview SDK promoted threeContainermethods from internal/virtual to public abstract.Description
CI workflow fix
dotnet add(bash\continuation breaks in PowerShell) withshell: bash+sedrewritingCosmosSDKVersiondirectlyCosmosSDKVersionfrom the emulator's.csprojto the rootDirectory.Build.props— onesednow drives thePackageReference, HybridRow hint path, and the new compile-time feature flag across all projectsNew abstract method implementations
Three methods guarded by
#if COSMOS_SDK_PREVIEW_METHODS(auto-defined whenCosmosSDKVersion >= 3.59.0):GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes<T>InMemoryAllVersionsChangeFeedProcessor<T>— delivers all versions + deletes asChangeFeedItem<T>with correctCreate/Replace/Deleteop-type detection via backward scan of the change feedGetPartitionKeyRangesAsync(FeedRange, CancellationToken)"0","1", …) matching the container'sFeedRangeCount, filtered by feed range overlapSemanticRerankAsyncInMemoryCosmosException(HttpStatusCode.BadRequest) — AI ranking is not emulatable in-memory, and the exception type matches what the real service returns socatch (CosmosException)blocks work correctlyAll three are also delegated in
PartitionKeyCapturingContainer.Bug fix: SemanticRerankAsync exception type
The original implementation threw
NotSupportedException(a .NET BCL type), but user code and SDK internals expectCosmosExceptionfor any Cosmos service-level error. Acatch (CosmosException)block would silently miss aNotSupportedException, causing it to surface as an unhandled exception. Fixed to throwInMemoryCosmosException(which extendsCosmosException) withHttpStatusCode.BadRequest.Type of Change
Checklist
dotnet test)