-
Notifications
You must be signed in to change notification settings - Fork 3.9k
refactor(schema): add a new column for storing large customer user agents in mandate table #8616
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
Conversation
Changed Files
|
customer_user_agent
from 255
to 512
in mandate
table
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.
We can't do this, we'll get query cache plan errors when the application is running, which would in turn cause the application to throw 5xx responses.
CC: @jarnura
ah, makes sense! this would indeed cause query cache plan errors! we should either use |
customer_user_agent
from 255
to 512
in mandate
table1f0c58a
to
c0eef83
Compare
v2_migrations/2025-07-20-174239_customer_device_user_agent/up.sql
Outdated
Show resolved
Hide resolved
…ser_agent_extended`
customer_user_agent_extended: mandate_new | ||
.customer_user_agent_extended | ||
.clone() | ||
.or_else(|| mandate_new.customer_user_agent.clone()), |
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.
Nit: This could have been a method implemented on the type.
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.
will not mark these as resolved, will consider them in a separate pr.
// Using customer_user_agent as a fallback | ||
customer_user_agent_extended: mandate_new | ||
.customer_user_agent_extended | ||
.or_else(|| mandate_new.customer_user_agent.clone()), |
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.
Same here, you could have called the method here.
// Using customer_user_agent as a fallback | ||
user_agent: mandate | ||
.customer_user_agent_extended | ||
.or(mandate.customer_user_agent) |
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 can also be a method implemented on the type (without the unwrap_or_else()
part).
…rver * 'main' of github.com:juspay/hyperswitch: (24 commits) chore(version): 2025.07.28.1 feat(core): Hyperswitch <|> UCS Mandate flow integration (#8738) feat(themes): Create user APIs for managing themes (#8387) chore: update devDependencies for cypress (#8735) refactor: Add routing_approach other variant to handle unknown data (#8754) chore(version): 2025.07.28.0 refactor(connector): [facilitapay] move destination bank account number to connector metadata (#8704) feat(recovery-events): add revenue recovery topic and vector config to push these events to s3 (#8285) ci(cypress): add authorizedotnet connector (#8688) refactor(schema): add a new column for storing large customer user agents in mandate table (#8616) feat(authentication): add authentication api for modular authentication (#8459) feat(connector): [MPGS] template code (#8544) fix(chat): append request id to headers for chat request (#8680) feat(connector): [Flexiti]template code for flexiti connector (#8714) chore(version): 2025.07.25.0 feat(core): Consuming locale in PaymentsAuthorizeData from SessionState (#8731) fix(payment-methods): fetch payment method details in payouts flow (#8729) refactor(core): remove hardcoded timeout limit of 5s for outgoing webhook requests (#8725) feat(connector): [Breadpay]Add support for Breadpay connector (#8676) fix(feature_matrix): refunds are supported by jpmorgan (#8699) ...
Type of Change
Description
customer_user_agent
column inmandate
table has a255
character length limit. Lately, there have been increased number of5xx
errors due to the values incustomer_user_agent
column hitting that limit. This PR addresses this by introducing a new columncustomer_device_user_agent
withTEXT
type in themandate
table and also addscustomer_user_agent
as a fallback.Generate and run migrations:
v1:
v2:
Additional Changes
/migrations
/v2_migrations
Motivation and Context
Below seems to have become a recurring issue where
customer_user_agent
constantly hits the255
character limit:How did you test it?
Did a mandate payment:
CIT
MIT
There's no 5xx around this "customer_user_agent" now
"customer_user_agent" is getting stored in the db in the new column
Check v2 DB
Command:
Note
Tested for
v1
but not forv2
Checklist
cargo +nightly fmt --all
just clippy && just clippy_v2