Skip to content

Skip users deleted during the onboarding cron run - #1462

Merged
helpcodeai merged 1 commit into
mainfrom
fix/onboarding-cron-deleted-user
Nov 3, 2026
Merged

helpcodeai merged 1 commit into
mainfrom
fix/onboarding-cron-deleted-user

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

The onboarding reminder cron failed with a 500 on 2026-11-02 at 20:18 UTC (Sentry ANYTHINGMCP-CLOUD-BACKEND-C): a user deleted between the candidate pull and the reminder stamp made prisma.user.update throw P2025, and the whole run stopped. That user is now skipped and the run goes on with the others. Other database errors still fail the run.

Cloud only (the cron runs on Cloud); self-hosted is unaffected. The file is under packages/backend/src/ee/; Matteo approved ee/ changes for fixes he asks for.

Changes

  • updateUser() helper in OnboardingCronService: stamps the user, returns false on P2025 (with a warning), rethrows anything else.
  • Used for the reminder 1 (holdout and sent), reminder 2 and activation reminder stamps. A skipped user gets no product event.
  • Two specs: a deleted holdout user is skipped while the next candidate still gets reminder 1; a non-P2025 error still fails the run.

Type

  • Bug fix

Testing

  • Added/updated unit tests
  • Backend checks run in CI (npm run lint, npx tsc --noEmit -p tsconfig.json, npm test in packages/backend); local Jest is not usable in this worktree because of a shared Prisma client.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally (CI)
  • This PR has a descriptive title

Related Issues

Fixes ANYTHINGMCP-CLOUD-BACKEND-C

The reminder loop stamped each candidate with prisma.user.update. A user
deleted between the candidate pull and the stamp threw P2025 and failed
the whole run with a 500 (Sentry ANYTHINGMCP-CLOUD-BACKEND-C, 2026-11-02
20:18 UTC). Such a user is now skipped and the run goes on; other
database errors still fail it.

Fixes ANYTHINGMCP-CLOUD-BACKEND-C
@helpcodeai
helpcodeai merged commit 4c2586d into main Nov 3, 2026
15 checks passed
@helpcodeai
helpcodeai deleted the fix/onboarding-cron-deleted-user branch November 3, 2026 07:04
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant