Skip to content

fix: accept notion data source parent webhooks#20709

Merged
lancy merged 3 commits into
mainfrom
fix/notion-database-item-webhook-parent
Jul 9, 2026
Merged

fix: accept notion data source parent webhooks#20709
lancy merged 3 commits into
mainfrom
fix/notion-database-item-webhook-parent

Conversation

@lancy

@lancy lancy commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Accept Notion webhook parent payloads that provide data_source_id without a type field.
  • Resolve database item created events from data.parent.data_source_id when present.
  • Update the Notion webhook test to cover the official 2026 page.created database item shape.

Context

While validating the notion-database-item-created workflow trigger, Notion sent page.created webhook payloads for database items using the official 2026 shape: data.parent includes id and data_source_id, but no type. The previous schema required parent.type, causing these events to be rejected before they could enqueue the workflow event.

Verification

  • Attempted: pnpm --dir turbo/apps/api test src/signals/routes/__tests__/webhooks-notion.test.ts
  • Result: local test command could not start because node_modules is missing in this checkout (vitest: not found). CI should run the targeted suite with installed dependencies.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../signals/services/notion-workflow-event.service.ts 80.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

API preview: https://pr-20709-api.vm6.ai

@lancy lancy changed the title fix: accept Notion data source parent webhooks fix: accept notion data source parent webhooks Jul 9, 2026
@lancy

lancy commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

LGTM

PR_AUTO_REVIEW_COMMIT: 2584dfb
PR_AUTO_REVIEW_VERDICT: LGTM

Summary

This PR accepts the Notion 2026 database item webhook parent shape where data.parent includes data_source_id without a type field. The routing logic now treats data_source_id as the data source parent, while page-parent matching skips those events so database item creates do not get misclassified as child-page events.

Findings

Critical (P0)

  • None.

High Priority (P1)

  • None.

Testing

  • Coverage: Adequate. The existing Notion webhook integration test now covers the official database item page.created payload with id plus data_source_id and no parent type, and still exercises pending event insertion for the data source scope.
  • Conventions: Compliant. The test remains an API integration test and does not add internal mocks, direct fetch mocking, fake timers, or database mocking.
  • Execution: Not run locally in this review; CI is rerunning on head 2584dfb after the title fix and empty commit trigger.

@lancy lancy added this pull request to the merge queue Jul 9, 2026
Merged via the queue into main with commit b5b478c Jul 9, 2026
92 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in VM0 Kanban Jul 9, 2026
@github-actions github-actions Bot mentioned this pull request Jul 9, 2026
@github-actions github-actions Bot deleted the fix/notion-database-item-webhook-parent branch July 9, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant