aglinxinyuan opened a new issue, #7097:
URL: https://github.com/apache/texera/issues/7097

   ### Task Summary
   
   The websocket model tier under 
`amber/src/main/scala/org/apache/texera/web/model/websocket/` has no test 
coverage at all — no spec exists anywhere under `amber/src/test` for that 
package.
   
   The gap that matters is not the DTOs themselves (most are bare case classes) 
but their Jackson polymorphic registration, which is a cross-language contract:
   
   - `TexeraWebSocketRequest` and `TexeraWebSocketEvent` both carry 
`@JsonTypeInfo(use = Id.NAME, include = As.PROPERTY, property = "type")`.
   - No `@JsonSubTypes.Type` entry specifies `name =`, and there is no 
`@JsonTypeName` in the package, so Jackson's `TypeNameIdResolver` falls back to 
the bare simple class name as the wire discriminator.
   - The Angular client hard-codes those same strings 
(`frontend/src/app/workspace/types/workflow-websocket.interface.ts`).
   
   So renaming a Scala class, or adding an explicit `name =`, silently changes 
the wire protocol with no compile error on either side.
   
   Add specs that pin this contract, driving the same `JSONUtils.objectMapper` 
production uses:
   
   - deserialize every registered request subtype through 
`classOf[TexeraWebSocketRequest]` (the `WorkflowWebsocketResource` entry 
point), and assert the registered id set against the annotation itself
   - reject an unknown and a missing type id
   - pin `ResultPaginationRequest`'s default arguments, which are the live path 
because the client declares those fields optional
   - assert the emitted discriminator for event subtypes (events are 
serialize-only, server to client)
   - cover `PaginatedResultEvent`'s companion-object field projection
   
   ### 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]

Reply via email to