-
Notifications
You must be signed in to change notification settings - Fork 40
Check on Presentation display availability in getAvailability can never be true #388
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
Comments
Sorry, I don't follow. The availability will be set to true if there is a display in the list of available presentation displays that is compatible, found earlier by the monitoring steps. |
Well, the step 7 I was looking at is now step 6: "If the presentation display availability for presentationRequest is not null, then: [...]". The problem boils down to whether the user agent can reset the presentation availability promise at some point in time, as I alluded to in a comment on PR #390: #390 (comment) If it cannot (which is how I read the current algorithm), then the promise will be set in any further call to Now, if the user agent can garbage collect the presentation availability promise once it is settled and/or no longer referenced, then step 6. remains useful! That step would also be useful if |
Okay, I am starting to understand what you are getting at. Thanks for your patience. The question is whether the availability promise/object is tied to the lifetime of the request that created them, which means they are created once and only once. Or, if they can be GCed independently from the request and recreated later. I believe the intention is that the developer can use the lifetime of the availability object to control when the browser is engaged in continuous monitoring of displays, and responsible usage would discard the object when the site isn't offering a UX to start presentation. We didn't add a specific Unless we go that route, GC should be able to discard the availability object/promise independent of the request, and in that case, we would need to recreate them if getAvailability() is called again. @schien Does that make sense? Any other input? |
No problem, I can tell my comments are getting more and more convoluted :)
OK, this issue becomes moot in that case. |
I believe this should be addressed by PR #387. |
One last one :) My apologies for not seeing that before as well!
getAvailability
is the only algorithm that sets the presentation display availability. That algorithm also creates (and never resets) the presentation availability promise.The presentation display availability will always be
null
the first timegetAvailability
is called so condition in step 7 that checks on the presentation display availability will always evaluate tofalse
. The presentation availability promise will always be set in subsequent calls togetAvailability
, meaning that the algorithm will stop at step 2, return that promise, and never reach step 7.In short, unless I missed something, I believe that step (and substeps) can be dropped.
This did not happen before because there was no such thing as a "presentation availability promise".
The text was updated successfully, but these errors were encountered: