Skip to content

Conversation

@comandeo-mongo
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings August 25, 2025 08:18
@comandeo-mongo comandeo-mongo requested a review from a team as a code owner August 25, 2025 08:18
@comandeo-mongo comandeo-mongo requested a review from jamis August 25, 2025 08:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the return value of the Mongoid.transaction method to return the value yielded from the block instead of internal state. Previously, the method was returning the result of run_commit_callbacks rather than the block's return value.

Key changes:

  • Modified the transaction method to properly return the block's yield value
  • Added test coverage to verify the correct return value behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/mongoid/clients/sessions.rb Fixed transaction method to return block value using tap to preserve return value while running callbacks
spec/mongoid/clients/transactions_spec.rb Added test to verify transaction returns the block's value and restructured existing test setup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@comandeo-mongo comandeo-mongo added the bug Fixes a bug, with no new features or broken compatibility label Aug 25, 2025
@comandeo-mongo comandeo-mongo merged commit e70aeaf into mongodb:9.0-stable Aug 25, 2025
62 checks passed
@comandeo-mongo comandeo-mongo deleted the 5885-backport-9.0 branch August 25, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes a bug, with no new features or broken compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants