fix(events): handle domain verification failed#1543
Conversation
|
Oh crap, I've screwed with the indentation. My editor got a bit aggressive. I'll try to fix that. |
b5a4467 to
1a24e70
Compare
|
Okay, should be resolved. |
Greptile SummaryThis PR fixes a bug where
Confidence Score: 5/5Safe to merge — the fix is well-scoped, follows established codebase patterns exactly, and is validated by a test that directly exercises the previously-broken scenario. All six changed files contain no P0 or P1 issues. The implementation correctly models the schema difference, the deserialization logic is fully consistent with every other event type in the codebase, and the new test validates the full round-trip from raw API response to deserialized event. The No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant API as WorkOS API
participant EL as listEvents()
participant ES as deserializeEvent()
participant ODVF as deserializeOrganizationDomainVerificationFailed()
participant OD as deserializeOrganizationDomain()
API->>EL: EventResponse { event: 'organization_domain.verification_failed',<br/>data: { reason, organization_domain: {...} } }
EL->>ES: deserializeEvent(eventResponse)
Note over ES: case 'organization_domain.verification_failed'
ES->>ODVF: deserializeOrganizationDomainVerificationFailed(data)
ODVF->>OD: deserializeOrganizationDomain(data.organization_domain)
OD-->>ODVF: OrganizationDomain (camelCase fields)
ODVF-->>ES: OrganizationDomainVerificationFailed { reason, organizationDomain }
ES-->>EL: OrganizationDomainVerificationFailedEvent
EL-->>API: { data: [OrganizationDomainVerificationFailedEvent] }
Greploops — Automatically fix all review issues by running Reviews (2): Last reviewed commit: "fix(events): handle domain verification ..." | Re-trigger Greptile |
The domain verfication failed events have a slightly different schema to other organization domain events. This was causing the data to be parsed incorrectly in the list events api resulting in empty `data` properties. I've added the required interfaces, serializers, and deserializers to capture the difference and parse the events successfully. I've also added some unit tests for the serialization.
1a24e70 to
70dfa4e
Compare
|
looks great, thank you! |
Description
The domain verfication failed events have a slightly different schema to other organization domain events. This was causing the data to be parsed incorrectly in the list events api resulting in empty
dataproperties.I've added the required interfaces, serializers, and deserializers to capture the difference and parse the events successfully. I've also added some unit tests for the serialization.
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.