Skip to content

fix: support setting cookies from MiddlewareResponse #2027

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

Merged
merged 22 commits into from
Apr 4, 2023
Merged

Conversation

Skn0tt
Copy link
Contributor

@Skn0tt Skn0tt commented Apr 4, 2023

Summary

Fixes https://github.com/netlify/pillar-support/issues/350

Test plan

  1. added an e2e test

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/642c7cb93ff1ed0008c08d9d
😎 Deploy Preview https://deploy-preview-2027--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/642c7cb9d69fda0008edf3c2
😎 Deploy Preview https://deploy-preview-2027--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Apr 4, 2023
@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/642c7cb965bc410008b84c96
😎 Deploy Preview https://deploy-preview-2027--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/642c7cb9b66d8200073ee6bc
😎 Deploy Preview https://deploy-preview-2027--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/642c7cb9d1c23100080c4b87
😎 Deploy Preview https://deploy-preview-2027--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/642c7cb9f59b3c000742d591
😎 Deploy Preview https://deploy-preview-2027--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/642c7cb9796e8100083dbdc8
😎 Deploy Preview https://deploy-preview-2027--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/642c7cb9796e8100083dbdcd
😎 Deploy Preview https://deploy-preview-2027--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit 8ffb737
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/642c7cb9ed3f0d0008808381
😎 Deploy Preview https://deploy-preview-2027--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Skn0tt Skn0tt changed the title fix: try building repro fix: support setting cookies from MiddlewareResponse Apr 4, 2023
@Skn0tt Skn0tt self-assigned this Apr 4, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

These files are the tests from the Next.js repo, so shouldn't have new ones added. New ones should go in either Cypress or Jest tests

Copy link
Contributor

Choose a reason for hiding this comment

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

that's true (and let me know if you want me to move them @Skn0tt because the folder structure can be a bit difficult to navigate)
however, i've wondered for a while whether we should use the Next.js repo pattern for our own e2e/integration tests - i.e. spinning up small, specific Next.js apps rather than testing against the demo sites, which include a mixed bag of functionality - it seems easier to reason around

Copy link
Contributor

Choose a reason for hiding this comment

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

Absolutely. They should be a new suite of tests though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and let me know if you want me to move them @Skn0tt because the folder structure can be a bit difficult to navigate

that'd be lovely, yeah!

i'm not sure wether mix fix actually fixes the problem, but having tests in the right directory would definitely help :D

@orinokai
Copy link
Contributor

orinokai commented Apr 4, 2023

@taty2010 could you cast your eye over this, because I think you were dealing with a PR not long ago that involved cookies and middleware?

@Skn0tt Skn0tt marked this pull request as ready for review April 4, 2023 14:03
@Skn0tt Skn0tt requested a review from a team April 4, 2023 14:03
@Skn0tt
Copy link
Contributor Author

Skn0tt commented Apr 4, 2023

got everything working locally, would appreciate some help with the failing CI tests!

@taty2010
Copy link
Contributor

taty2010 commented Apr 4, 2023

currently looking into the failing tests.

Copy link
Contributor

@taty2010 taty2010 left a comment

Choose a reason for hiding this comment

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

prev failing tests are now passing and everything else looks gtm

Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

Tested this with @taty2010. 🚢

@kodiakhq kodiakhq bot merged commit a630ab4 into main Apr 4, 2023
@kodiakhq kodiakhq bot deleted the repro-cookies branch April 4, 2023 21:16
@Skn0tt
Copy link
Contributor Author

Skn0tt commented Apr 5, 2023

thanks for taking this across the finish line!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants