Skip to content

Feed the cloud membership mirror from login and member writes - #2004

Merged
RhysSullivan merged 1 commit into
member-directory/seamfrom
member-directory/feeders
Sep 16, 2026
Merged

RhysSullivan merged 1 commit into
member-directory/seamfrom
member-directory/feeders

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Layer 2 of 5. Cloud only.

  • Login callback lists the user's memberships once and uses that list both to choose the landing org and to upsert the user and memberships into the mirror. No new WorkOS calls; the old per-candidate live checks are gone.
  • Write-through on createOrganization, acceptInvitation, inviteMember (mirrors the pending membership), removeMember, and updateMemberRole.
  • Feeder writes run in one transaction that share-locks the org row and the account row, so a stalled feeder cannot insert past a committed backfill scan, user deletion, or membership deletion.
  • One-off backfill apps/cloud/scripts/backfill-workos-mirror.ts (db:backfill-workos-mirror:prod, --dry-run). Records the replay boundary once before its first listing, applies each org's scan atomically with a per-org backfilled_at mark, tombstones memberships WorkOS no longer lists, and stamps a global completion marker. Idempotent. Not run yet.
  • Mirror queries live in workos-mirror-store.ts with no Cloudflare imports so the script runs the same upserts under bun.

@RhysSullivan
RhysSullivan added this pull request to stack #2008 September 15, 2026 11:05
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 15, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 73a4cef Commit Preview URL

Branch Preview URL
Sep 16 2026, 05:42 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 15, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 73a4cef Sep 16 2026, 05:43 PM

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Sep 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@2004

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@2004

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@2004

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@2004

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@2004

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@2004

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@2004

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@2004

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@2004

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@2004

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@2004

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@2004

executor

npm i https://pkg.pr.new/executor@2004

commit: 73a4cef

@RhysSullivan
RhysSullivan force-pushed the member-directory/feeders branch from 08442f4 to 35557cc Compare September 16, 2026 16:24
@RhysSullivan
RhysSullivan removed this pull request from stack #2008 September 16, 2026 16:26
@RhysSullivan
RhysSullivan added this pull request to stack #2027 September 16, 2026 16:27
@RhysSullivan
RhysSullivan force-pushed the member-directory/feeders branch from 35557cc to 73a4cef Compare September 16, 2026 17:40
@RhysSullivan
RhysSullivan marked this pull request as ready for review September 16, 2026 18:01
@RhysSullivan
RhysSullivan merged commit ddfe3f5 into main Sep 16, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant