Skip to content

fix(dsync): match spec payloads for dsync.activated and dsync.deleted - #132

Open
burkestar wants to merge 1 commit into
workos:mainfrom
burkestar:fix/dsync-activated-domains
Open

burkestar wants to merge 1 commit into
workos:mainfrom
burkestar:fix/dsync-activated-domains

Conversation

@burkestar

Copy link
Copy Markdown

Fixes #128

Problem

dsync.activated and dsync.deleted events reused the REST Directory shape. For dsync.activated that meant a singular domain and no domains array, so workos-python 10.5's DsyncActivatedData.from_dict raised. That failed the whole GET /events page.

Changes

  • dsync.activated: replaces domain with domains, an array of the organization's domains as { object: 'organization_domain', id, domain }. Reports state with the event-catalog names (linked becomes active, unlinked becomes inactive).
  • dsync.deleted: drops domain and external_key, which the spec doesn't include for this event, and reports state: 'deleting'.
  • Seeded directories now get a generated external_key when the config doesn't give one. The spec requires it as a string on both the Directory object and the dsync.activated payload.
  • The REST /directories response shape is unchanged.

Testing

Note for reviewers

domains lists all of the directory's organization's domains, not only the one matching the directory's domain field. That's my reading of the docs' "domains array of Organization Domain". Happy to narrow it if production behaves differently.

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Critical risk] Changes the public API contract for directory events.

The PR appears safe to merge; no actionable issue was established.

Summary

This PR gives directory activation and deletion events event-specific payloads while leaving the REST directory shape intact.

  • Activation events include organization domains, event-state names, and a string external key.
  • Deletion events omit fields outside the specified payload and report the deleting state.
  • Tests cover both event shapes and the REST response.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Seed[Seed directory] --> Insert[Directory insert hook]
  Insert --> Activated[dsync.activated payload]
  Seed --> REST[REST directory response]
  Delete[Delete directory] --> Removed[Directory delete hook]
  Removed --> Deleted[dsync.deleted payload]
Loading

Reviews (1) · Last reviewed commit: "fix(dsync): match spec payloads for dsyn..."

burkestar added a commit to burkestar/emulate that referenced this pull request Oct 6, 2026
burkestar added a commit to burkestar/emulate that referenced this pull request Oct 6, 2026
Fork build carrying workos#130 and workos#132 until upstream releases
them. The release-please manifest stays at 0.14.0 so upstream releases
merge cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

dsync.activated payload has 'domain' instead of 'domains', breaking workos-python 10.5 event parsing

1 participant