-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: remove and resolve FIXME
s and TODO
s from db module
#174
Conversation
@@ -340,10 +346,9 @@ mod storage { | |||
"{}_{}", | |||
payment_attempt.payment_id, payment_attempt.merchant_id | |||
); | |||
// TODO: need to add an application generated payment attempt id to distinguish between multiple attempts for the same payment id | |||
// Check for database presence as well Maybe use a read replica here ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is not required either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fixed, below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm referring to this comment:
Check for database presence as well [...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check it out, I also feel it's an actionable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done the change, please take a look and suggest improvement, if any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add an application generated payment attempt id to distinguish between multiple attempts for the same payment id
Now that I re-read this comment, I don't think we're determining multiple attempts to the same payment ID in our code, are we?
Looks like we're just setting the attempt_id
to be an UUID here:
https://github.com/juspay/orca/blob/03d0cb1f5e256da6973932f388bab8d9e758bda6/crates/router/src/core/payments/operations/payment_create.rs#L437
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was regarding how it is being saved in the kv, previously it was only marked as pa
, but later it was modified to be pa_{}
in the redis hashmap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, yes! Currently we only have one-to-one mapping between payment_intent
and payment_attempt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was regarding how it is being saved in the kv, previously it was only marked as
pa
, but later it was modified to bepa_{}
in the redis hashmap
Ahh right, my bad, I misinterpreted it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: need to add an application generated payment attempt id to distinguish between multiple attempts for the same payment id
is this talking about adding attempt id to the key?
can be remove the allow_panics too? |
@@ -340,10 +346,9 @@ mod storage { | |||
"{}_{}", | |||
payment_attempt.payment_id, payment_attempt.merchant_id | |||
); | |||
// TODO: need to add an application generated payment attempt id to distinguish between multiple attempts for the same payment id | |||
// Check for database presence as well Maybe use a read replica here ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: need to add an application generated payment attempt id to distinguish between multiple attempts for the same payment id
is this talking about adding attempt id to the key?
Hey @ashokkjag, this comment is regarding the field value used to store the payment attempt in the hash map, earlier it was stored as |
Type of Change
Description
This change addresses
todo!()
in theMockDb
interface implementation and group them under issue #172 . It fixes and removes otherFIXME
s from the db folder.Additional Changes
Motivation and Context
Following the initiative of removing
TODO
s andFIXME
s.Linked issues:
FIXME
's and redundent files #168How did you test it?
Checklist
cargo +nightly fmt
cargo clippy