Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PRDP-220] Fix queue-cosmos desync #99

Merged
merged 9 commits into from
Nov 20, 2023

Conversation

svariant
Copy link
Collaborator

@svariant svariant commented Nov 17, 2023

List of Changes

  • Implemented save receipt method in Cosmos client
  • Reworked BizEventToReceipt function logic
  • Fixed RecoverFailedReceiptTest that was losing the receipt status in case of error sending the event to queue
  • Updated unit tests

Motivation and Context

Issue PRDP-220
The event was sent to the queue before the receipt was saved on cosmos.
This was causing errors in the ReceiptGenerator that was triggered by the queue but couldn't find the relative receipt in the cosmos.

How Has This Been Tested?

Unit tests have been updated and run

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

A new type of error code has been defined (904) in case of generic errors in the cosmos client, the documentation

Copy link

This PR exceeds the recommended size of 400 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

Comment this PR with update_code to update openapi.json and format the code. Consider to use pre-commit to format the code.

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

91.7% 91.7% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@pasqualespica pasqualespica left a comment

Choose a reason for hiding this comment

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

great 🚀

@pasqualespica pasqualespica merged commit f187da6 into main Nov 20, 2023
9 of 12 checks passed
svariant added a commit that referenced this pull request Nov 21, 2023
* [PRDP-220] Added save receipt method to cosmos client

* [PRDP-220] Added new reason error code for cosmos

* [PRDP-220] Implemented cosmos client and refactored code

* [PRDP-220] Changed BizEventToReceipt function logic to fix queue-cosmos desynch

* [PRDP-220] Updated unit tests

* [PRDP-220] Fix RecoverFailedReceipt function save failed queue status

* [PRDP-220] Fixed Cosmos Client insert by generating custom id for receipt

* [PRDP-220] Update unit tests

* [PRDP-220] Added charset utf-8 to bizEvent stringify
pasqualespica added a commit that referenced this pull request Nov 23, 2023
* [PRDP-224] Changed cart item subject retrieve logic

* [PRDP-224] Updated unit tests

* [PRDP-220] Fix queue-cosmos desync (#99)

* [PRDP-220] Added save receipt method to cosmos client

* [PRDP-220] Added new reason error code for cosmos

* [PRDP-220] Implemented cosmos client and refactored code

* [PRDP-220] Changed BizEventToReceipt function logic to fix queue-cosmos desynch

* [PRDP-220] Updated unit tests

* [PRDP-220] Fix RecoverFailedReceipt function save failed queue status

* [PRDP-220] Fixed Cosmos Client insert by generating custom id for receipt

* [PRDP-220] Update unit tests

* [PRDP-220] Added charset utf-8 to bizEvent stringify

* Bump to version 1.7.0

* Bump to version 1.7.0-1 [skip ci]

* [PRDP-224] Updated unit tests

* [PRDP-224] Fixed condition transfer list exist

* [PRDP-224] Updated unit tests

* [PRDP-224] Implemented regex for remittance information retrieving

* [PRDP-224] Cleaned code

* [PRDP-224] Changed regex

---------

Co-authored-by: pagopa-github-bot <[email protected]>
Co-authored-by: pasqualespica <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants