Skip to content

mcp: add ServerSession.NotifyResourceUpdated - #1524

Open
nahapetyan-serob wants to merge 1 commit into
mainfrom
serob/add-NotifyResourceUpdated
Open

nahapetyan-serob wants to merge 1 commit into
mainfrom
serob/add-NotifyResourceUpdated

Conversation

@nahapetyan-serob

Copy link
Copy Markdown
Contributor

closes #1265

Comment thread mcp/server.go
Comment on lines +1730 to +1732
server.mu.Lock()
ids := slices.Clone(server.resourceSubscriptions[params.URI][ss])
server.mu.Unlock()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's add this check before as params.URI might be nil

Suggested change
server.mu.Lock()
ids := slices.Clone(server.resourceSubscriptions[params.URI][ss])
server.mu.Unlock()
if params == nil {
return fmt.Errorf("%w: params cannot be nil", jsonrpc2.ErrInvalidParams)
}
if params.URI == "" {
return fmt.Errorf("%w: URI cannot be empty", jsonrpc2.ErrInvalidParams)
}

This branch has not been deployed

No deployments
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.

mcp: a resource update cannot be delivered to one session, and the caller's context never reaches the sending middleware

2 participants