feat: add primary key not null query to generic filter function#7785
Merged
Gnanasundari24 merged 5 commits intomainfrom Apr 17, 2025
Merged
Conversation
Changed Files
|
2 tasks
2 tasks
| schema_v2::payment_attempt::table | ||
| ); | ||
|
|
||
| // Manual implementations below |
Member
There was a problem hiding this comment.
Why did we have to write these implementations manually?
jarnura
approved these changes
Apr 13, 2025
SanchithHegde
approved these changes
Apr 15, 2025
pixincreate
added a commit
that referenced
this pull request
Apr 21, 2025
…acilitapay-pix-pmt * 'main' of github.com:juspay/hyperswitch: (21 commits) refactor(required_fields): move pm required fields to pm crate (#7539) fix(connector): [noon] address `next_action_url` being `null` for cards in 3ds payment (#7832) refactor(middleware): add middleware to record metrics for request count and duration (#7803) chore(version): 2025.04.18.0 chore(postman): update Postman collection files fix(connector): [globalpay] handle edge case where currency comes as empty upon payment decline (#7812) refactor(cypress-v2): change `Authorization` and `payment_methods_enabled` for v2 cypress tests (#7805) fix(connector): [Cybersource] send type selection indicator for co-batch cards (#7828) feat(payment_method): add logic for setup_future_usage downgrade and add filter based on zero mandate config (#7775) refactor(accounts): move dashboard_metadata table to accounts_schema and point v2 to v1 dashboard_metadata (#7793) chore(analytics): opensearch client creation based on config (#7810) ci(postman): update assertion error message for nmi collection (#7765) feat: add primary key not null query to generic filter function (#7785) chore(version): 2025.04.17.0 chore: change payment method files ownership to `hyperswitch-payment-methods` (#7808) feat(vsaas): modify api key auth to support vsaas cases (#7593) ci(cypress): verify mandate id to be `null` if payment id not `succeeded` (#7749) feat(connector): [chargebee] consumes required fields to support transaction monitoring (#7774) ci(configs): remove vault private key from configs (#7825) chore(version): 2025.04.16.0 ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Since schema for both v1 and v2 can be unified, it paves way for a new bug.
In v1, while querying a record with a column that is common for both v1 and v2, the query may retrieve list of records belonging to both v1 and v2.
Now v1 application will be able to deserialise v1 records in the list without any problems. But v2 records would have few v1 required fields as null. This records will not be deserialized by the v1 application.
For example:
Lets say an orgnization has both v1 and v2 merchants.
Lets do merchant list by organization_id in v1. This will fetch all v1 and v2 merchant_accounts from the DB. Since merchant_id column will not be populated in v2 records, it will cause deserialization failure.
Fix:
In order to fix this problem, for all filter DB queries in application, we will add
AND PRIMARY_KEY IS NOT NULLalong with existing where clause. This way v2 created records will not be fetched in v1 application.This will also make sure list endpoint in v2 application won't fail when backfill is not made.
Additional Changes
Motivation and Context
How did you test it?
Response:
Response:
Response:
Only v1 merchants are being returned.
Response: (only v1 merchant list should be returned).
But in DB, there are v1 as well as v2 merchants.

DB query has the appropriate IS NOT NULL clause.

Checklist
cargo +nightly fmt --allcargo clippy