Skip to content

fix: Add missing optional transaction in database relational methods - #2656

Merged
hampuslavin merged 12 commits into
serverpod:mainfrom
hampuslavin:hl_fix_missing_transaction
Aug 26, 2024
Merged

hampuslavin merged 12 commits into
serverpod:mainfrom
hampuslavin:hl_fix_missing_transaction

Conversation

@hampuslavin

@hampuslavin hampuslavin commented Aug 23, 2024 •

Copy link
Copy Markdown
Contributor

Description

  • The transaction parameter was not exposed in all database methods which means they could not be used in the context of a transaction (see Exception when using attachRow() inside a transaction #2442 for an example).
  • There might be tests missing (please point out if you think so) but primarily the existing test had an incorrect expectation where transaction was missing from expected parameters.

Changes

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.

@hampuslavin
hampuslavin force-pushed the hl_fix_missing_transaction branch from 205bd06 to 8654105 Compare August 23, 2024 07:05
@hampuslavin
hampuslavin marked this pull request as ready for review August 23, 2024 07:12
@hampuslavin
hampuslavin requested a review from SandPod August 23, 2024 07:13

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work!

One suggestion to change around the added transaction test and then a question around if we cover all scenarios.

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just one thought regarding the transaction test and a small nit for the test matching.

@hampuslavin hampuslavin changed the title fix: Add missing optional transaction in database methods fix: Add missing optional transaction in database relational methods Aug 26, 2024
@hampuslavin
hampuslavin merged commit c3d818b into serverpod:main Aug 26, 2024
@hampuslavin
hampuslavin deleted the hl_fix_missing_transaction branch August 26, 2024 11:14
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception when using attachRow() inside a transaction

2 participants