Skip to content

[Bug] Fix usage of transaction provider when calling sync Add on Dynamo DB outbox#3536

Merged
iancooper merged 2 commits into
BrighterCommand:masterfrom
dhickie:fix_dynamo_outbox_transaction
Feb 26, 2025
Merged

[Bug] Fix usage of transaction provider when calling sync Add on Dynamo DB outbox#3536
iancooper merged 2 commits into
BrighterCommand:masterfrom
dhickie:fix_dynamo_outbox_transaction

Conversation

@dhickie

@dhickie dhickie commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

Currently, when the synchronous Add method is called on the DynamoDb outbox, it fails to pass on any transaction provider, if supplied. That means that when one is supplied, the transaction isn't used and the item is added straight to the outbox table.

This PR fixes this by passing on the transaction provider. It also updates the DynamoDb transaction provider to correctly set the LastResponse property, as this isn't being set currently when calling the synchronous Commit method.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates Failed
Prevent hotspot decline (1 hotspot with Code Duplication)
Enforce advisory code health rules (1 file with Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
DynamoDbOutbox.cs 1 rule in this hotspot 7.12 → 6.91 Suppress
Enforce advisory code health rules Violations Code Health Impact
DynamoDbOutbox.cs 1 advisory rule 7.12 → 6.91 Suppress

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

)
{
AddAsync(message, requestContext, outBoxTimeout).ConfigureAwait(ContinueOnCapturedContext).GetAwaiter().GetResult();
AddAsync(message, requestContext, outBoxTimeout, transactionProvider).ConfigureAwait(ContinueOnCapturedContext).GetAwaiter().GetResult();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

❌ Getting worse: Code Duplication
introduced similar code in: Add

Suppress

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates Failed
Prevent hotspot decline (1 hotspot with Code Duplication)
Enforce advisory code health rules (1 file with Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
DynamoDbOutbox.cs 1 rule in this hotspot 7.12 → 6.91 Suppress
Enforce advisory code health rules Violations Code Health Impact
DynamoDbOutbox.cs 1 advisory rule 7.12 → 6.91 Suppress

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants