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

clarify that Client "creation order" means when reserved Client created #1078

Closed
wanderview opened this issue Feb 21, 2017 · 7 comments
Closed

Comments

@wanderview
Copy link
Member

The Clients.matchAll() method says to sort Clients in creation order (among other things). I just want to confirm this means the sorted by the time the reserved client was created. Alternatively, it could mean when the environment backing the Client actually became Execution Ready.

I favor the reserved client creation time because it provides a reasonable sort order for reserved clients included in the list.

@jungkees
Copy link
Collaborator

jungkees commented Feb 24, 2017

I favor the reserved client creation time because it provides a reasonable sort order for reserved clients included in the list.

That sounds good to me. One thing I want to think about is the case where an execution ready client (i.e. an environment settings object) that has never been focused may have been created earlierlater than a reserved client (i.e. an environment before getting copied to the potential environment settings object.) The current text allows this. Would it make sense?

EDIT: s/earlier/later/

@wanderview
Copy link
Member Author

That sounds good to me. One thing I want to think about is the case where an execution ready client (i.e. an environment settings object) that has never been focused may have been created earlier than a reserved client (i.e. an environment before getting copied to the potential environment settings object.) The current text allows this. Would it make sense?

Sorry, I don't follow. Can you give me an example?

@jungkees
Copy link
Collaborator

Sorry about the confusion first of all. I edited my comment above using a strikethrough: s/earlier/later/. Basically, I was concerned about the case where client.reserved == true client comes before client.reserved == false client.

I think I'd have to dig into the definition of focused, focusable area and such more, but this is the scenario I was thinking about:

SW A, B, and C for the same origin with different scopes are running. SW C running matchAll() captures the following state:

  1. SW A calls windowClient.navigate(url).
  2. Reserved client for A created during navigate A.
  3. SW B calls clients.openWindow(url).
  4. Reserved client for B created during navigate B.
  5. After fetching the resource for navigate B, reserved client for B is fully transferred to an execution ready client. (I.e., the environment settings object is created.)
  6. Navigate A's still fetching resource without its environment settings object and global created.

The matchAll() from SW C returns [ .. , windowClient_A, windowClient_B, ..] even though windowClient_A is still reserved and windowClient_B is execution ready.

@wanderview
Copy link
Member Author

The matchAll() from SW C returns [ .. , windowClient_A, windowClient_B, ..] even though windowClient_A is still reserved and windowClient_B is execution ready.

Yea, I think this is ok. Most callers won't see this since you have to opt-in to reserved clients.

@wanderview
Copy link
Member Author

Or we could sort reserved clients to the back of the list, and then creation order within reserved clients.

@jakearchibald
Copy link
Contributor

F2F: Reserved client creation time is fine. We should look into how to spec it.

@jakearchibald
Copy link
Contributor

We aren't going to expose reserved clients, so this is no longer an issue.

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

3 participants