qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[🐞] SSR Redirect (from Action) with Query Parameter doesn't work properly.

Open fprl opened this issue 2 years ago • 4 comments

Which component is affected?

Qwik City (routing)

Describe the bug

Hi there, thanks for checking this repro. I'm facing this issue where redirecting to the same page with query params inside a routeAction is not working.

You can test this by changing the first select to "Redirect to same page" or "Redirect to test page" (where it works).

PS: This is probably related to https://github.com/BuilderIO/qwik/issues/5342

Thanks!

Reproduction

https://github.com/fprl/qwik-formaction-redirect

Steps to reproduce

  1. npm run dev
  2. Change the first select to "Redirect to same page" or "Redirect to test page" and submit to see the difference (also check console logs).

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M1
    Memory: 83.69 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    Yarn: 3.6.3 - ~/.yarn/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
    pnpm: 8.5.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 119.0.6045.159
    Safari: 17.0
  npmPackages:
    @builder.io/qwik: ^1.2.19 => 1.2.19 
    @builder.io/qwik-city: ^1.2.19 => 1.2.19 
    undici: ^5.26.0 => 5.27.2 
    vite: ^4.4.11 => 4.5.0

Additional Information

No response

fprl avatar Nov 22 '23 12:11 fprl

The problem is that the redirect is changed, when redirecting to /?bedrooms=%222%22 the returned value is /q-data.json?bedrooms=%222%22

Something between the routeAction and the browser does that, so either qwik-city or the service-worker

wmertens avatar Nov 22 '23 12:11 wmertens

Thanks for your response, I will check Qwik repo later to see if I can isolate the issue

fprl avatar Nov 22 '23 13:11 fprl

I faced this issue also, though https://github.com/BuilderIO/qwik/issues/5342 was already closed, I still got this weird behavior.

My Qwik Version :

{
  "@builder.io/qwik": "^1.4.0",
  "@builder.io/qwik-city": "^1.4.0",
}

fmgono avatar Feb 11 '24 00:02 fmgono

@fmgono here are the test cases for the fix, is your situation different?

https://github.com/BuilderIO/qwik/pull/5349/files#diff-39ec843cb34bf02b43d65685129628d1ab2a7124e5ae9549d115eec4482e5adf

It would be great if you could make a reproduction on https://qwik.new

wmertens avatar Feb 11 '24 07:02 wmertens

closing unless there is a reproduction with latest qwik

PatrickJS avatar May 10 '24 23:05 PatrickJS