puniverse / comsat

Fibers and actors for web development
docs.paralleluniverse.co/comsat
Other
598 stars 103 forks source link

AutoWebActorHandler session handling #62

Closed roded closed 8 years ago

roded commented 8 years ago

AutoWebActorHandler first creates a session and then tries creating an actor based on the current HttpServerExchange. In cases where the first HTTP path requested it not handled by any defined WebActors (a case which is now possible since the HTTP handlers can be chained), a new session will be created with a null actor reference, leaving the user of the session unable to initiate a WebActor even when the requested path should be handled by it (that is, only till the session invalidates). I think the session should be created only if an actor relevant to the exchange was found. An easy fix, though not ideal, would be to check the actorRef in AutoContextProvider and invalidate the session if no actorRef is found.

roded commented 8 years ago

An attempt at a solution: https://github.com/roded/comsat/commit/1e37acee294b1d793acef39231f2373704a8f4b3

circlespainter commented 8 years ago

Looks good, could you create a PR?