x
x copied to clipboard
fix(powernap): use req.Notif to detect notifications in Router
Router.Route compared req.ID to jsonrpc2.ID{} to distinguish notifications from requests. Since jsonrpc2.ID{} has Num: 0, any server-initiated request with integer ID 0 (e.g. the first outgoing request from lsp_server/ty) was misrouted as a notification, skipping its registered handler entirely.
Use req.Notif instead, which is correctly set by Request.UnmarshalJSON based on whether the "id" field is present in the JSON.
Also guard against nil req.Params to prevent panics when a server sends a request or notification without a params field.
- [x] I have read
CONTRIBUTING.md. - [ ] I have created a discussion that was approved by a maintainer (for new features).