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: return 404 when server function not found #1775

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

loetjvr
Copy link
Contributor

@loetjvr loetjvr commented Feb 9, 2025

fixes #1779

What is the current behavior?

Currently server functions calls are expected to always provide the correct id and name. However in our use case we have had bots that try to access older id and name combinations which results in a 500 error.

What is the new behavior?

This change treats not found server functions with a 404 response so that it provides better logging results in case an older or wrong id is being accessed directly.

Copy link

changeset-bot bot commented Feb 9, 2025

⚠️ No Changeset found

Latest commit: cbea1b8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

netlify bot commented Feb 9, 2025

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit cbea1b8
🔍 Latest deploy log https://app.netlify.com/sites/solid-start-landing-page/deploys/67a9c4eae9a1660008db4cb8
😎 Deploy Preview https://deploy-preview-1775--solid-start-landing-page.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 configuration.

@atilafassina
Copy link
Member

atilafassina commented Feb 9, 2025

Thanks a lot for this PR, @loetjvr
I think it's a great fix to throw a 404 instead of letting a 500 when the server-function name can't be found.

Looking at the code and our compliance tasks, I'd like to ask for a few additional things if you're ok with it:

  1. Could you please create an issue describing why this is a problem (you can copy/paste from your PR description where it makes sense) and feel free to @ me if you want.
  2. Add to the PR description fixes ### with the issue so our automation can pick up on that
  3. I think in DEV mode your error code is perfect, but how about we leave the "server function not found" message out in production? I think it's better for security that we don't offer additional hints on how the system work in this case.
  4. Add a changeset with a patch type

Let me know your thoughts if you don't agree.

Cheers 🏆

@loetjvr
Copy link
Contributor Author

loetjvr commented Feb 10, 2025

More than happy to make the changes @atilafassina
I did not see any of these requests in the contributions md so was a bit unsure what was required

Also on point number 4, what does this entail? I updated the pr title, should I update somewhere else as well?

@loetjvr loetjvr changed the title return 404 when server function not found patch: return 404 when server function not found Feb 10, 2025
@birkskyum birkskyum changed the title patch: return 404 when server function not found fix: return 404 when server function not found Feb 10, 2025
@birkskyum birkskyum merged commit 576d60d into solidjs:main Feb 10, 2025
10 of 11 checks passed
@atilafassina
Copy link
Member

More than happy to make the changes @atilafassina I did not see any of these requests in the contributions md so was a bit unsure what was required

Also on point number 4, what does this entail? I updated the pr title, should I update somewhere else as well?

That's entirely on us, @loetjvr
we're still improving the process (just merged some important CI tests as requirement)

Now that your PR reached main, I'll make the changes needed on another one.

Thanks a lot for your work!! 🏆

@loetjvr loetjvr deleted the server-fn-404 branch February 11, 2025 14:34
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.

[Feature?]: return 404 when server function not found
3 participants