Skip to content

fix: avoid double encoding when notifying dev server of activity #7300

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 1 commit into from
May 15, 2025

Conversation

VitaliyR
Copy link
Contributor

@VitaliyR VitaliyR commented May 15, 2025

…oxying

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes double encoding and marking preview server activity.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@VitaliyR VitaliyR requested a review from davbree May 15, 2025 15:15
@VitaliyR VitaliyR requested a review from a team as a code owner May 15, 2025 15:15
Copy link

github-actions bot commented May 15, 2025

📊 Benchmark results

Comparing with b4c6ca6

  • Dependency count: 1,148 (no change)
  • Package size: 271 MB (no change)
  • Number of ts-expect-error directives: 397 (no change)

@VitaliyR VitaliyR force-pushed the vitaliir/WRFL-2541 branch from 96cdf5d to b3b3f5e Compare May 15, 2025 15:17
@@ -365,7 +365,7 @@ const serveRedirect = async function ({
(await isEndpointExists(decodeURIComponent(reqUrl.pathname), options.target))
if (staticFile || endpointExists) {
const pathname = staticFile || reqUrl.pathname
req.url = encodeURI(pathname) + reqUrl.search
req.url = encodeURI(decodeURI(pathname)) + reqUrl.search
Copy link
Member

Choose a reason for hiding this comment

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

why decodeURIComponent on line 365 and decodeURI here? can we use the same one and share the result?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's iterate on this, I need this released faster, and this micro optimization not worth the additional testing effort

@VitaliyR VitaliyR force-pushed the vitaliir/WRFL-2541 branch from b3b3f5e to 69d2a0d Compare May 15, 2025 15:49
@serhalp serhalp changed the title WRFL-2541 Fix notify activity dev server. Fix double encoding when pr… fix: avoid double encoding when notifying dev server of activity May 15, 2025
Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

SGTM if you need this hotfixed and you've tested it manually, but afterward could you please add more context to the PR description and consider adding test coverage? 🙏🏼

@ndhoule
Copy link
Contributor

ndhoule commented May 15, 2025

Request: Once we merge this, can you come back through and add comments that explain the problem and why we're doing what we're doing in this code? And a test, if possible?

The problem is non-obvious from this PR and from the code (I still don't know what the problem this solves is).

@ndhoule
Copy link
Contributor

ndhoule commented May 15, 2025

Oh. Well...what Phil said. 😆

@VitaliyR
Copy link
Contributor Author

I've added it in the task btw, but I'm planning to put some refactor there, so I will add the comments into the code as well

@VitaliyR VitaliyR merged commit 86e539e into main May 15, 2025
52 checks passed
@VitaliyR VitaliyR deleted the vitaliir/WRFL-2541 branch May 15, 2025 16:09
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.

3 participants