[#4] OpenAPI: Replace EventPayload with the generated WSEvent - #4297
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (63)
📒 Files selected for processing (130)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Generated by 🚫 Danger |
SDK Performance
|
martinmitrevski
left a comment
There was a problem hiding this comment.
looks good in general, couldn't spot anything suspicious apart from the handling of the connected events.
| // `connection.ok` and `connection.error` are not part of the generated `WSEvent`, and custom | ||
| // event types are surfaced through the public unknown event types. Known event types which | ||
| // failed to decode must not be reported as unknown events, otherwise the failure goes unnoticed. | ||
| if let event = try? decoder.decode(ConnectedEvent.self, from: data) { return event } |
There was a problem hiding this comment.
hmm, this is not pretty. How are we doing it on video/feeds?
There was a problem hiding this comment.
I'll implement https://linear.app/stream/issue/CHA-5606 to get connected events as generated events like video and feeds get. Not sure why chat was left out.
There was a problem hiding this comment.
PR is up for chat and updated this branch with those changes. I was thinking about doing this cleanup later, but why not now.
# Conflicts: # Sources/StreamChat/Generated/OpenAPI/APIs/DefaultEndpoints.swift
# Conflicts: # Scripts/openapi_generate.sh
# Conflicts: # Scripts/openapi_generate.sh
# Conflicts: # Sources/StreamChat/Generated/OpenAPIDecodable.stencil
# Conflicts: # Scripts/openapi_generate.sh
Public Interface- public final class HealthCheckEvent: ConnectionEvent, EventDTO, Sendable
+ public final class HealthCheckEvent: ConnectionEvent, Sendable |
SDK Size
|
StreamChat XCSize
Show 121 more objects
|
|
|
@testableapple used #4300 for QAing the whole stack of PRs. Marking this one as QAed as well. |



🔗 Issue Links
Resolves: IOS-1847
🎯 Goal
Decode WebSocket and
/syncevents into the generatedWSEventand event DTOs instead of the hand-writtenEventPayload.📝 Summary
EventDecoderreturnsWSEvent;EventNotificationCenterunwraps it into the publicEventtypesDatabaseSession.saveEventwork withWSEventEventPayloadand the hand-written event DTOs are removed🛠 Implementation
This is the event part of #4288; the tree matches it.
connection.okandconnection.errorstay hand-written until they are in the chat v2 spec (CHA-5606).🎨 Showcase
N/A
🧪 Manual Testing Notes
☑️ Contributor Checklist
docs-contentrepo