aglinxinyuan opened a new issue, #7300: URL: https://github.com/apache/texera/issues/7300
### Task Summary `WorkflowWebsocketResource` (62 lines, 0%) has no spec. The endpoint is thin, but two parts of it are real logic nothing else guards: - **The write-access gate on `WorkflowExecuteRequest`.** It is the only consumer of the privilege `myOnOpen` parses off the handshake, and it must both report to the client and rethrow. Unreachable in single-node mode, where `ServletAwareConfigurator` hard-codes WRITE, but live under Kubernetes where the privilege comes from the `x-user-computing-unit-access` header. - **The catch-all error mapper**, which stamps every failure as `COMPILATION_ERROR` with a placeholder operator and routes it to the socket when there is no execution, then rethrows. It is drivable with a mocked `javax.websocket.Session` — the pattern `CollaborationResourceSpec` already uses — plus a `SessionState` registered directly, so no real workflow is created. A `WorkflowService` test double is needed for the init path: a real `disconnect()` drops the user count to zero and reaches `AmberRuntime.scheduleCallThroughActorSystem`, whose actor system is null in a unit JVM. Things to leave alone, each because a test would pin an accidental failure rather than a contract: `myOnOpen`'s missing-parameter and bogus-privilege paths (NPE / IndexOutOfBounds / IllegalArgumentException); `ModifyLogicRequest`, whose reconfiguration service is null until `executeWorkflow` has run; and `ResultPaginationRequest`, whose no-workflow case is a discarded `Option.foreach`. Two things worth recording while in here: - `objectMapper.readValue` sits **outside** the try, so an unparseable frame escapes un-mapped and the client is told nothing. - With a workflow attached but no execution, `executionService.getValue` returns null, so `workflowStateOpt.map(...)` yields `Some(null)`, which slips past the `case None` guard and NPEs instead of raising the intended "execution is not initialized". Also note the fatal-error `type` field is a scalapb enum that serializes as an **object**, not a string, so the client reads `type.name`. Worth pinning, since flattening it would break the frontend's error panel silently. ### Task Type - [ ] Refactor / Cleanup - [ ] DevOps / Deployment / CI - [x] Testing / QA - [ ] Documentation - [ ] Performance - [ ] Other -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
