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

fix #1538 #1539

Merged
merged 1 commit into from
Nov 5, 2024
Merged

fix #1538 #1539

merged 1 commit into from
Nov 5, 2024

Conversation

huumn
Copy link
Member

@huumn huumn commented Nov 5, 2024

fix #1538

afaict this fixes the cyclical dep issue. Breaking cyclical deps in yup requires pairs of tie breakers, e.g. [['apiKey', 'apiKeyRecv'],['currency', 'currencyRecv']]. Before #1479, we were coincidentally tie breaking using an array of all field names (with sometimes more than 2 members).

I did not read the issue fully before that describes this escape hatch: jquense/yup#176 (comment)

QA: 6. I couldn't test blink in full, but it passes validation now if one of field pairs are set and doesn't pass if neither of them are. I also disabled validation on the client to test it on the server (it also fails if both requiredWithout fields aren't set, and succeeds if one is set).

@huumn huumn requested a review from riccardobl November 5, 2024 00:48
Copy link
Member

@riccardobl riccardobl left a comment

Choose a reason for hiding this comment

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

This fixes it, thanks.
But empty fields do not use the default values, eg. if i type nothing into the currency field it will error saying configuration must be able to send or receive because the currency field is empty, while it should be set to BTC by the validation
.transform(value => value ? value.toUpperCase() : 'BTC')

@riccardobl riccardobl self-requested a review November 5, 2024 09:10
Copy link
Member

@riccardobl riccardobl left a comment

Choose a reason for hiding this comment

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

With this and: #1540
everything is back to work as expected 👍

@huumn huumn merged commit 7efd089 into master Nov 5, 2024
6 checks passed
@huumn huumn deleted the fix-1538 branch November 5, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New wallet validation code has cyclic dependency
2 participants