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

Encode action result in cookie #12016

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Encode action result in cookie #12016

merged 2 commits into from
Sep 17, 2024

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Sep 17, 2024

Changes

  • base64 encode the action result that is saved within the cookie in the redirect flow.
  • Additionally this trims down the input errors to only the used fields, otherwise it's very easy for it to be too large.
  • Fixes Astro Actions - Cookie Too large #11973

Testing

  • Test added with a large form, 10 fields, all having validation errors.

Docs

N/A, bug fix

Copy link

changeset-bot bot commented Sep 17, 2024

🦋 Changeset detected

Latest commit: a9d2610

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Sep 17, 2024
body = {
type: res.error.type,
issues: res.error.issues,
fields: res.error.fields
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting that we need to parse out issues and fields manually here. What was it passing before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The entire error object which includes the stack and the message both of which can be quite long, and including either results in this test being too large.

Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

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

This should result in fewer errors!

@matthewp matthewp merged commit 837ee3a into next Sep 17, 2024
13 checks passed
@matthewp matthewp deleted the large-cookie-actions branch September 17, 2024 19:13
@matthewp matthewp mentioned this pull request Sep 17, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants