Skip to content

Conversation

@Tratcher
Copy link
Member

@Tratcher Tratcher commented Sep 8, 2021

Fixes #27733

IsAvailable does not mean "has the session been loaded yet?", it means "did it load without error?"

@Tratcher Tratcher added this to the 7.0-preview1 milestone Sep 8, 2021
@Tratcher Tratcher self-assigned this Sep 8, 2021
Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These APIs suck

@Tratcher Tratcher merged commit b46c5d5 into main Sep 9, 2021
@Tratcher Tratcher deleted the tratcher/sessionload branch September 9, 2021 15:50
@Tratcher
Copy link
Member Author

Tratcher commented Sep 9, 2021

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

@csturm83
Copy link

These APIs suck

@davidfowl I kind of agree. They don't follow SRP.

Would it maybe be worth a new implementation where:

  • Load could be public and throw on failure like LoadAsync does (maybe could extend ISession with a DIM?)
  • Methods that currently call Load could throw InvalidOperationException if !_loaded to enforce the usage pattern of calling Load or LoadAsync first.
  • IsAvailable might not be needed, since load and commit failures (Exceptions) would be the indicators of availability?

Those are just some thoughts I had. There might be other concerns or limitations I haven't thought of. Just throwing it out there 🙂.

@ghost
Copy link

ghost commented Nov 17, 2021

Hi @csturm83. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loading session state asynchronously - potential usage problem

5 participants