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

behavior for close connection when browser reload & close #127

Open
Jxck opened this issue Jul 14, 2020 · 13 comments
Open

behavior for close connection when browser reload & close #127

Jxck opened this issue Jul 14, 2020 · 13 comments

Comments

@Jxck
Copy link

Jxck commented Jul 14, 2020

IIUC, there are no spec for behavior when browser reload or closed.
(and also, current chrome implementation remains connection after reload)
It seems reasonable for me to

  • reload: immediate close
  • close: idle timeout (there are nothing browser can do)
@yutakahirano
Copy link
Contributor

I expect something similar to https://fetch.spec.whatwg.org/#concept-fetch-group-terminate.

@KensakuKOMATSU
Copy link

Hi, I'm new here.

I found the issue which immediate close does not work when calling explicit close and reload from client-side.
I also opened the bug ticket for it, https://bugs.chromium.org/p/chromium/issues/detail?id=1110775 .

Everyone can check and see this issue from my repository, https://github.com/KensakuKOMATSU/QuicTransport-test .

My opinion is that the spec should note that immediate close SHOULD be supported when browser reloaded . I think this is natural behavior and allows casual coding for generic JS developers which we can prevent abusing server side resources.

@wilaw wilaw added this to the Minimum viable ship milestone Jun 9, 2021
@wilaw wilaw added the Discuss at next meeting Flags an issue to be discussed at the next WG working label Jun 9, 2021
@jan-ivar
Copy link
Member

jan-ivar commented Jul 6, 2021

Meeting:

@yutakahirano yutakahirano removed the Discuss at next meeting Flags an issue to be discussed at the next WG working label Jul 6, 2021
@yutakahirano
Copy link
Contributor

We should terminate the WebTransport session. Calling cleanup may be useful in some cases (e.g., nested frames).

@domenic, do you have any suggestions for specifying this behavior? Do we need to add cleanup steps in Dedicated/Shared workers?
@nhiroki for workers.

@domenic
Copy link

domenic commented Jul 7, 2021

Oh, this is somewhat strange. For example the HTML spec seems to never close WebSocket or EventSource connections opened by workers. That is probably a bug.

However it does clean up some stuff in https://html.spec.whatwg.org/#run-a-worker and https://html.spec.whatwg.org/#terminate-a-worker

I will open a HTML issue to clean this up and give you a nice place to hook in.

@yutakahirano
Copy link
Contributor

Sorry for the late response & thank you very much for filing the bug, @domenic!

I'm going to create a PR to whatwg/html for documents, and leave a TODO there for workers.

yutakahirano added a commit to yutakahirano/html that referenced this issue Jul 13, 2021
yutakahirano added a commit that referenced this issue Jul 14, 2021
Before this change, #webtransport-session links to
"WebTransport session" and #webtransport-session① links to
"[[Session]]" for="WebTransport.

In order to have a public link to "[[Session]]" at
whatwg/html#6856, add "for=protocol" to
the link to "WebTransport session".

With this change #protocol-webtransport-session links to
"WebTransport session", and #webtransport-session links to
[[Session]].

This is for #127.
@yutakahirano yutakahirano self-assigned this Jul 15, 2021
@yutakahirano
Copy link
Contributor

I changed my mind, and a PR for WebTransport is ready for review. I'll merge it on Monday (JST) if there are no objections.

@yutakahirano
Copy link
Contributor

Merged the PR. We have a TODO for workers so I'm leaving this issue open, but removing the milestone.

@FZambia
Copy link

FZambia commented Aug 6, 2023

I just tried using WebTransport in Chrome (Version 115.0.5790.170 (Official Build) (x86_64)) and Chrome canary (Version 117.0.5931.0 (Official Build) canary (x86_64)) - and WT sessions are not automatically closed upon browser reload - i.e. I am reloading browser window and do not get disconnection events on server side. So streams are only closed by a server upon hitting ping/pong timeout in my case.

This was happening originally, then worked well in some previous Chrome versions - and now seems to be broken again. Could someone confirm? Probably it's an issue in quic-go I am using for WebTransport 🤔

@simbleau
Copy link

Relevant: #600

@jan-ivar
Copy link
Member

Hi @FZambia, note this repo is for discussing issues on the WebTransport specification. Please file implementation issues with the specific vendor, in this case the chromium issue tracker.

(Note #600 appears to be about tab switching which differs from document unload/reload.)

@chris13524
Copy link

Why is disconnect on tab reload desirable? Isn't it cheaper server-side to keep the connection open?

@FZambia
Copy link

FZambia commented Jul 29, 2024

Why is disconnect on tab reload desirable? Isn't it cheaper server-side to keep the connection open?

I want to know immediately when some client leaves the app, but actually I mostly concerned about automatic streams closing, not the entire HTTP/3 connection. Stream represent some logical unit in my case with a state which should be re-created from scratch in reload case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants