Skip to content

feat(audit-logs): Allow events without an occurrence timestamp - #1751

Closed
swaroopThereItIs-workos wants to merge 1 commit into
mainfrom
codex/audit-logs-optional-occurred-at
Closed

swaroopThereItIs-workos wants to merge 1 commit into
mainfrom
codex/audit-logs-optional-occurred-at

Conversation

@swaroopThereItIs-workos

Copy link
Copy Markdown
Contributor

Why

Audit Logs callers should be able to use the server's default occurrence timestamp without constructing a Date in the SDK. createEvent now accepts an omitted occurredAt and leaves occurred_at out of the JSON request. Explicit dates keep their existing serialization, and automatic idempotency keys are unchanged.

Proof

  • Against the unchanged SDK, the new omitted/undefined request cases both fail with a .toISOString() TypeError. Against this change, both send an event without occurred_at.
  • An explicit 2026-11-03T12:34:56.789Z Date still reaches the request body as the same ISO timestamp.
  • Independent review of commit c0e28a4e796e5d58295bbd7f68248b82cd057b37 found no remaining blocking issues after removing the obsolete 24-hour expiry promise. The reviewer independently ran the Audit Logs suite: 37 tests passed.

Not proven

The server default is part of the coordinated Audit Logs backend change and is not asserted to be deployed. Release this SDK change only after backend support is available everywhere. The source proposal is https://app.notion.com/p/3f9d458aea8b8064a8c8fb86fa6673a5.

@swaroopThereItIs-workos
swaroopThereItIs-workos marked this pull request as ready for review November 3, 2026 23:35
@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The SDK change appears safe to merge.

Summary

Makes occurredAt optional when creating Audit Log events.

  • Audit Log event calls can leave the occurrence timestamp to WorkOS.
  • Audit Log docs no longer promise a 24-hour idempotency-key lifetime.

No actionable issues found. swaroopThereItIs-workos identifies the 24-hour expiry promise as obsolete and acknowledges that release must wait for backend support everywhere. Tests were inspected, not run during this review.

Reviews (1) · Last reviewed commit: "feat(audit-logs): make occurredAt option..." · Reviewed by Greptile

@swaroopThereItIs-workos
swaroopThereItIs-workos deleted the codex/audit-logs-optional-occurred-at branch November 4, 2026 17:08
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.

1 participant