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

[🐞] The components that uses server$ doesn't recovery after once be offline even if the network is recovered. #6651

Open
genki opened this issue Jul 9, 2024 · 7 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@genki
Copy link
Contributor

genki commented Jul 9, 2024

Which component is affected?

Qwik Runtime

Describe the bug

I am trying to make a qwik app that can work even while the network is offline.
I expected the server$ is not working if the network is offline.
But not expected once the network went offline, the app never to be recovered even if the network is recovered again.

sshot79.mp4

Relating with QwikDev/qwik-evolution#105

Expected behaviour

The execution of the server$ would fail while network is offline, but it becomes online, then the execution of the server$ is succeeded.
In the preview mode, it works same as in the dev mode.

Reproduction

https://github.com/genki/qwik-test/tree/offline_recovery_test

Steps to reproduce

Please git clone the repo above and

pnpm i
pnpm run dev

to visit the page on the browser.

Then,

  1. Click the links "Top" and "Demo" at the footer to check if the navigation is working.
  2. By using the dev tools, change the network status to "offline".
  3. Confirm the navigation would fail to move to the "Top" that is using the server$ and see the errors in the console.
  4. Change the network status to "no throttling" to recover the network.
  5. Click the "Top" link and confirm the navigation is still not working even if the network is online.

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 145.81 MB / 24.00 GB
    Shell: 3.6.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 20.12.1 - /opt/homebrew/opt/node@20/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.5.0 - /opt/homebrew/opt/node@20/bin/npm
    pnpm: 9.4.0 - ~/Library/pnpm/pnpm
    bun: 1.1.3 - ~/.bun/bin/bun
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.5
  npmPackages:
    @builder.io/qwik: file:../../clone/qwik/packages/qwik/dist => 1.5.6-dev20240709001810 
    @builder.io/qwik-city: file:../../clone/qwik/packages/qwik-city => 1.5.6 
    typescript: 5.1.6 => 5.1.6 
    undici: 5.22.1 => 5.22.1 
    vite: 4.4.0 => 4.4.0

Additional Information

No response

@genki genki added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Jul 9, 2024
@genki genki changed the title [🐞] components that uses server$ doesn't recovery after once be offline even if the network is recovered. [🐞] The components that uses server$ doesn't recovery after once be offline even if the network is recovered. Jul 9, 2024
@genki
Copy link
Contributor Author

genki commented Jul 9, 2024

If you remove the call of server$ from the "Top" page, the navigation is stay working even if go offline and of course after it is back.
Maybe the fail of the dynamic import in the qwikloader crushes something.

@gioboa
Copy link
Member

gioboa commented Jul 9, 2024

Hi, can you simulate this behaviour with an old version like 1.3.2 pls?
Is this appending in preview mode?

@genki
Copy link
Contributor Author

genki commented Jul 9, 2024

@gioboa
In the preview mode, it happened that the "Demo" label getting multiplied per clicking "Top" link while the network is offline.

sshot79b.mov

But the navigation has been recovered after the network is back online.

I will try to test with the qwik-1.3.2

@genki
Copy link
Contributor Author

genki commented Jul 9, 2024

@gioboa
I have tested with the qwik-1.3.2 (dev & preview), all behaviours were exactly same.

@gioboa
Copy link
Member

gioboa commented Jul 9, 2024

Thanks for your tests. Can you add the expected behaviour in the description pls?

@genki
Copy link
Contributor Author

genki commented Jul 9, 2024

@gioboa Yes, I added.

@genki
Copy link
Contributor Author

genki commented Jul 9, 2024

The one of the reasons of this issue may be which there's no error handling for this line.

const res = await fetch(`${origin}?${QFN_KEY}=${qrlHash}${query}`, config);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants