webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

Refactor session handling for better integration with BiDi

Open jgraham opened this issue 4 years ago • 2 comments
trafficstars

This is a large change, but it's almost entirely refactoring.

The main aim here is to split the session concept so that there's a base "session" which holds the session id and state that's appropriate to both WebDriver classic and BiDi. Then, we define a "HTTP Session" as one that has the HTTP Flag set and use that to compose-in any state that's only used in the classic HTTP-based protocol.

In addition, we rework the way state is passed around the spec so that we are using an explicit session object, rather than making use of a global "current session". This makes things clearer if we allow the possibility of multiple non-HTTP sessions.

There is also a bit of cleanup in the way we pass other variables around, and in the capabilites processing.


Preview | Diff


Preview | Diff

jgraham avatar Jul 14 '21 11:07 jgraham

CC'ing @foolip and @bwalderman for their reviews. It would be great to get this PR landed.

whimboo avatar Oct 15 '21 05:10 whimboo

I've done a round of fixup here.

One thing that apparently isn't very obvious from the text is how I'm thinking about the session flags. The basic idea was to have a single kind of session object, but let it compose together the HTTP session and BiDi session properties, so that we can have all of the combinations HTTP-only, BiDi-only, HTTP+BiDi, and extend to anything new we want in the future. So the idea was that the flags are used to specify which kind of session a given session is, and knowing that you can tell what properties it must have e.g. if a session is a HTTP session it must have a timeouts property that you can access, but a BiDi session doesn't. The idea wasn't to group together all the boolean properties of a session into a single flags object.

jgraham avatar Mar 18 '22 21:03 jgraham

Hi @shs96c. Would you mind following up on some of the replies from @jgraham? Not sure if you think that those issues are still relevant or can be closed. It would be nice to eventually get this massive PR merged. Thanks.

whimboo avatar Jun 21 '23 07:06 whimboo

it looks like there are no remaining unanswered questions and this PR needs a rebase?

OrKoN avatar Oct 10 '23 09:10 OrKoN