Skip to content

Conversation

@BC-ACherednichenko
Copy link
Owner

PR Tips

Typically, PRs should consist of a single commit, and so should generally follow
the rules for Go commit messages, with the following
changes and additions:

  • Markdown is allowed.

  • For a pervasive change, use "all" in the title instead of a package name.

  • The PR description should provide context (why this change?) and describe the changes
    at a high level. Changes that are obvious from the diffs don't need to be mentioned.

jba and others added 5 commits August 4, 2025 14:42
- SessionState holds the state of a ServerSession.

- SessionStore allows arbitrary storage for SessionState.

- ServerSession.InitSession provides a session ID, store and state
  to a ServerSession.
…ocol#213)

Previously, completions would always be advertised as a capability even
if the CompletionHandler was not installed by the server. This CL fixes
that.
- Add ForOptions to hold options for schema inference.

- Replace ForLax with ForOptions.IgnoreBadTypes.

- Add an option to provide schemas for arbitrary types.

- Provide a default mapping from types to schemas that includes stdlib
types with MarshalJSON methods.

- Add Schema.CloneSchemas. This is needed to make copies of the schemas
in the above map: a schema cannot appear twice in a parent schema,
because schema addresses matter when resolving internal references.
…ocol#231)

## Background

Since the Server has a map of ServersSessions->subscriptions, and takes
care of routing ResourceUpdate messages to ServerSessions, I think the
decision was made to leave *ServerSession out of the
SubscribeHandler/UnsubscribeHandler signatures. However, resource
subscriptions are not specific to the a particular client and this
information is kept private in the Session today.

## Proposal

Align the Subscribe/Unsubscribe handlers with the other two handlers
that are client specific (ProgressNotificationHandler, and
RootListChangeHanlder), and include *ServerSession in the signature.

It comes in practice because because a gateway server that needs to
forward subscriptions still needs this information. The routing logic in
Server is convenient and means that most servers won't need to know
which ServerSessions are subscribed. But I think there are still use
cases where the user will need to know.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants