fix: show better error message when incorrect otp is entered#29
fix: show better error message when incorrect otp is entered#29harshp4114 wants to merge 4 commits intoresilient-tech:version-15from
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe pull request updates the HDFC Bank API integration. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
bank_integration/bank_integration/api/hdfc_bank_api.py (1)
297-304: Simplify the redundant condition.The condition
(found and found[-1] == X) or (found and found[-1] == Y)can be simplified since both branches checkfoundfirst.♻️ Proposed simplification
- if ( - (found and found[-1] == invalid_otp_length_xpath) - or (found and found[-1] == incorrect_otp_xpath) - ): - + if found and found[-1] in (invalid_otp_length_xpath, incorrect_otp_xpath): self.throw( "You have entered an incorrect otp. Please start the payment process again" )
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 183f1ba7-9fbe-4999-86ce-db23e050fa81
📒 Files selected for processing (1)
bank_integration/bank_integration/api/hdfc_bank_api.py
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| bank_integration/bank_integration/api/hdfc_bank_api.py | Adds OTP error detection after submission — waits up to 5 s for error/success signals, then throws distinct messages for incorrect OTP vs. wrong OTP length. Logic is consistent with the rest of the codebase (_found_element[-1] pattern, AnyEC, throw="ignore"). Minor style nit: missing space in the CSS_SELECTOR tuple. |
Reviews (4): Last reviewed commit: "fix: resolve comments" | Re-trigger Greptile
1 similar comment
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bank_integration/bank_integration/api/hdfc_bank_api.py (1)
302-302: Minor: Inconsistent casing of "OTP" in error message.The error message uses lowercase "otp" while the standard abbreviation is "OTP" (as used in line 298).
✏️ Suggested fix
elif found[-1] == incorrect_otp_xpath: self.throw( - "You have entered an incorrect otp. Please start the payment process again" + "You have entered an incorrect OTP. Please start the payment process again." )
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 02fb30c8-aa75-4c11-90f1-e188f95c13e4
📒 Files selected for processing (1)
bank_integration/bank_integration/api/hdfc_bank_api.py
|
re-evaluate the whole pr and then just update the confidence score. also take in consideration that some changes are done in other pr's. Also regarding the xpath fragility of incorrect_otp_xpath, the element has only 2 things that can be used in the xpath that is class='text-danger' and the text 'You have entered incorrect OTP.'. so don't include that as a bug. |
|
re-evaluate the whole pr and then just update the confidence score. also take in consideration that some changes are done in other pr's. Also regarding the xpath fragility of incorrect_otp_xpath, the element has only 2 things that can be used in the xpath that is class='text-danger' and the text 'You have entered incorrect OTP.'. so don't include that as a bug. |
Closes: #24