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: Correctly set parent flow name in GovPayMetadata #3826

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Oct 18, 2024

What's the problem?

  • The Editor interface of the Pay component only ever knows about its own context - flowName will always be the flow it's held within
  • At runtime, as an applicant hits the public interface of the component, the context can be different - flowName is the root ("parent" flow)
  • This means that we send the incorrect flow name to GovPay

What's the solution?

  • Be a bit more smart about setting the defaults at runtime in the Public interface
  • Always overwrite with the current flow name, which is always correct

Testing

I didn't find a good way to test this (without setting up a new E2E test). Open to ideas!

You can test this manually here -

@DafyddLlyr DafyddLlyr marked this pull request as draft October 18, 2024 12:24
@DafyddLlyr
Copy link
Contributor Author

Copy link

github-actions bot commented Oct 18, 2024

Removed vultr server and associated DNS entries

@DafyddLlyr DafyddLlyr requested a review from a team October 18, 2024 13:31
? props.govPayMetadata
: defaultMetadata;

const metadata = [...(props.govPayMetadata || []), ...defaultMetadata];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before - defaults were only applied if nothing was set in the Editor.

Now - defaults overwrite any value set in the Editor, and are always correct and up to date.

@DafyddLlyr DafyddLlyr marked this pull request as ready for review October 18, 2024 13:32
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Pay-in-a-portal is definitely a new-to-me content pattern! Thanks for getting to bottom of this one, works for me ✔️

@DafyddLlyr DafyddLlyr merged commit 33ff4d7 into main Oct 18, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/govpay-metadata-flow-name branch October 18, 2024 13:59
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.

2 participants