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

Detect support for waitUntilAvailable=true? #613

Closed
martenrichter opened this issue Aug 4, 2024 · 12 comments
Closed

Detect support for waitUntilAvailable=true? #613

martenrichter opened this issue Aug 4, 2024 · 12 comments

Comments

@martenrichter
Copy link

I currently have the following issues:
I am running automated tests to get new streams.
If waitUntilAvailable=true is supported (there is no support currently, right?), the tests must run differently.
So far, the test for waitUntilAvailable=true has failed as there is no support (at least in Chrome). How should an application detect support for waitUntilAvailabl? It may be crucial, as the behavior for allocating streams may differ.

(Of course, this may be an unimportant detail, but it is a thought that came to me while writing tests. (However, until now, I manually select or deselect the tests depending on the browser engine.)

@wilaw wilaw added the Discuss at next meeting Flags an issue to be discussed at the next WG working label Aug 7, 2024
@jan-ivar
Copy link
Member

You should be able to feature detect it like this:

let supported = false;
wt.createUnidirectionalStream({get waitUntilAvailable() { supported = true; }});
console.log(supported); // true or false

This existing pattern relies on step 5 in createUnidirectionalStream. Please LMK if this is insufficient.

@jan-ivar jan-ivar removed the Discuss at next meeting Flags an issue to be discussed at the next WG working label Aug 21, 2024
@jan-ivar
Copy link
Member

Please reopen if this is still an issue.

@martenrichter
Copy link
Author

martenrichter commented Aug 27, 2024

I'm sorry for the late reply. For the last few weeks, I have been traveling with limited internet access.
It works.....Thanks!

@martenrichter
Copy link
Author

Another question: I have the impression that Firefox currently behaves as if waitUntilAvailable is set to true. Is this observation correct? I am wondering how to deal with it. Either write an exception in the test, or a patch for the browser....

@jan-ivar
Copy link
Member

jan-ivar commented Sep 9, 2024

Good question. cc @jesup and @vasilvv.

I'd assume both browsers today would behave as is waitUntilAvailable is true given that's what the spec said prior to #528.

If so, then defaulting to false may cause a bit of a headache.

@vasilvv
Copy link
Contributor

vasilvv commented Sep 9, 2024

I think the current Chrome behavior is waitUntilAvailable=false; there was a bug to fix that, but it was overcome by #528.

@martenrichter
Copy link
Author

Well, in my unit tests for stream flow control: https://github.com/fails-components/webtransport/blob/master/test/stream-limits.spec.js. Chromium behaves as waitUntilAvailable=false. Firefox behaves more like waitUntilAvailable=true, but as far as I interpret the behavior it is never available after all, at least this is what I currently think, but I am not sure (and this why I ask). So I believe, that apps, that open and close streams get a problem with interoperability.

@jan-ivar
Copy link
Member

Good point. I've filed bug 1917831 on Firefox to fix this. Thanks!

@martenrichter
Copy link
Author

Also, Chrome has close to 150 streams available, and Firefox has close to 100 streams available. (I think I have read that there was some consensus to choose a similar value.)

@jan-ivar
Copy link
Member

The server dictates the number of streams you can create, so if Chrome and Firefox differ that's a bug somewhere.

Maybe you're thinking of anticipatedConcurrentIncomingUnidirectionalStreams which says: "The user agent MUST initially allow at least 100 incoming unidirectional streams from the server.", but that's in the other direction.

@martenrichter
Copy link
Author

martenrichter commented Sep 10, 2024

Deleted.

@martenrichter
Copy link
Author

Ok, I have check it, I just forgot, that I used server side different limits for the two waituntilavailable values.

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

No branches or pull requests

4 participants