Skip to content

fix: add longitude, latitude, and timezone to RequestData.geo #1777

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 11 commits into from
Nov 18, 2022

Conversation

nickytonline
Copy link

@nickytonline nickytonline commented Nov 15, 2022

Summary

Test plan

  1. Visit the Deploy Preview (insert link to specific page) ...

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

Closes https://github.com/netlify/pod-ecosystem-frameworks/issues/305
Relates to https://github.com/netlify/pod-compute/issues/270
Relates to netlify/cli#5231

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 Nov 15, 2022

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

Name Link
🔨 Latest commit 36c0835
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/637772aaa0fb4c0009a9c114
😎 Deploy Preview https://deploy-preview-1777--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.

@netlify
Copy link

netlify bot commented Nov 15, 2022

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

Name Link
🔨 Latest commit 36c0835
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/637772aa171bba00092ad5d9
😎 Deploy Preview https://deploy-preview-1777--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.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Nov 15, 2022
@netlify
Copy link

netlify bot commented Nov 15, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo failed.

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6377b009105c7100768b4c62

@netlify
Copy link

netlify bot commented Nov 15, 2022

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

Name Link
🔨 Latest commit 36c0835
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/637772aa16a90a000a88b002
😎 Deploy Preview https://deploy-preview-1777--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 Nov 15, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo failed.

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6377b02bdd2ac3005e8f2868

@netlify
Copy link

netlify bot commented Nov 15, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo failed.

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6377b02ef9f514006c9e8cf4

@netlify
Copy link

netlify bot commented Nov 15, 2022

Deploy Preview for next-plugin-canary failed.

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6377b0321645e000508bf000

@netlify
Copy link

netlify bot commented Nov 15, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 36c0835
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/637772aa4d3a180008b8ca25
😎 Deploy Preview https://deploy-preview-1777--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 Nov 15, 2022

Deploy Preview for nextjs-plugin-next-11-demo failed.

Name Link
🔨 Latest commit 36c0835
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-next-11-demo/deploys/637772aacf03520009147fd3

@netlify
Copy link

netlify bot commented Nov 15, 2022

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

Name Link
🔨 Latest commit 36c0835
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/637772aa98e0fa0008952734
😎 Deploy Preview https://deploy-preview-1777--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.

@nickytonline nickytonline self-assigned this Nov 15, 2022
@nickytonline nickytonline force-pushed the nickytonline/add-long-lat-to-geo branch from 084127f to 6c44ddc Compare November 15, 2022 16:49
@nickytonline nickytonline changed the title fix: add longitude and latitude to RequestData.geo fix: add longitude, latitude, and timezone to RequestData.geo Nov 15, 2022
@nickytonline nickytonline marked this pull request as ready for review November 15, 2022 21:02
@nickytonline nickytonline requested a review from a team November 15, 2022 21:02
@nickytonline nickytonline marked this pull request as draft November 15, 2022 21:17
@nickytonline nickytonline force-pushed the nickytonline/add-long-lat-to-geo branch 2 times, most recently from 745e278 to 9b296f0 Compare November 16, 2022 00:58
Copy link
Author

@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.

In Netlify context, longitude and latitude are of type number, but Next.js types them as string | undefined. See https://nextjs.org/docs/api-reference/next/server#nextrequest. I wonder if on our end we should convert them to string to avoid any issues on the Next.js side. I do find it odd that they're not treated as numbers on the Next side though.

@nickytonline nickytonline force-pushed the nickytonline/add-long-lat-to-geo branch from 9b296f0 to 129a1d1 Compare November 16, 2022 01:13
@nickytonline nickytonline force-pushed the nickytonline/add-long-lat-to-geo branch from 129a1d1 to 949689a Compare November 16, 2022 01:14
@MarcL MarcL linked an issue Nov 16, 2022 that may be closed by this pull request
2 tasks
@nickytonline nickytonline marked this pull request as ready for review November 17, 2022 22:05
@nickytonline
Copy link
Author

I believe the failures for the checks are Next 11 related.

@nickytonline nickytonline force-pushed the nickytonline/add-long-lat-to-geo branch from 2926672 to 4d0801f Compare November 18, 2022 11:54
@@ -63,10 +64,13 @@ const handler = async (req: Request, context: Context) => {
return
}

const geo = {
const geo: RequestData['geo'] = {

Choose a reason for hiding this comment

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

Yay type!

Copy link

@sarahetter sarahetter left a comment

Choose a reason for hiding this comment

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

🎉

@nickytonline
Copy link
Author

There's Next 11 demo sites failing, but just going to see about the other site failures.

@nickytonline
Copy link
Author

Looks like all things Cypress are passing, so I think all the failures are related to Next 11 tests.

@nickytonline nickytonline merged commit 3f35549 into main Nov 18, 2022
@nickytonline nickytonline deleted the nickytonline/add-long-lat-to-geo branch November 18, 2022 16:20
@ascorbic
Copy link
Contributor

If you look at details you can see that several demo sites failed to build. I don't think it's the fault of this PR (I think it's npm-related) but Cypress tests alone won't say that everything is passing.

@nickytonline
Copy link
Author

nickytonline commented Nov 18, 2022

If you look at details you can see that several demo sites failed to build. I don't think it's the fault of this PR (I think it's npm-related) but Cypress tests alone won't say that everything is passing.

Are the Cypress tests passing because it's not using the DEPLOY URL? I remember @MarcL mentioning something about that on Slack. Also, I checked on #1781 and all the checks are good aside from the now failures for the Next 11 checks.

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

Successfully merging this pull request may close these issues.

[Bug]: middleware request.geo object is empty
3 participants