apache / apache/shenyu

[BUG] WebSocket `registerMetaData` field is dead — metadata always registered despite default `false`

Open Beginner friendly
#6,788 1 comment 0 reactions 0 assignees View on GitHub
client: register priority: medium type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

- Severity: Medium
- Location:
`shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuSpringWebSocketClient.java:75`; `.../annotation/ShenyuServerEndpoint.java:80`; `.../init/SpringWebSocketClientEventListener.java:167-182` (`handleClass`)
-
Description:
`ShenyuSpringWebSocketClient` and `ShenyuServerEndpoint` declare `boolean registerMetaData() default false;`. The new autoconfig path consumes this for SpringMvc (`ShenyuSpringMvcClientProcessorImpl.java:44-45`, `SpringMvcApiMetaRegister.java:137-138`, `MateDataApiRegistrarImpl.java:141`), but WebSocket has no processor/extractor in the new register path, and the legacy `SpringWebSocketClientEventListener.handleClass` unconditionally calls `getPublisher().publishEvent(metaData)` for every method without ever reading `registerMetaData`.
-
Impact:
The default `false` signals "do not register metadata", yet metadata is published on every refresh. Users cannot opt out of metadata registration for websocket endpoints; the annotation contract is unimplemented.
-
Suggested fix:
Gate `handleClass` metadata publishing on `beanShenyuClient.registerMetaData()` (and for `@ShenyuServerEndpoint`, read the aliased `registerMetaData`).
-
Confidence: High

---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ShenyuSpringWebSocketClient.java:75 and ShenyuServerEndpoint.java:80, then read SpringWebSocketClientEventListener.handleClass around lines 167-182. Trace how each annotation exposes registerMetaData and verify that metadata publication follows its value for both annotations, including the default false case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.