Skip to content

Revert the Suppress Ortto contact event added for giveth-v6-core#457 - #141

Merged
ae2079 merged 2 commits into
stagingfrom
revert/457-ortto-contact-suppression
Sep 6, 2026
Merged

ae2079 merged 2 commits into
stagingfrom
revert/457-ortto-contact-suppression

Conversation

@ae2079

@ae2079 ae2079 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Reverts #140. Counterpart to Giveth/giveth-v6-core#482.

giveth-v6-core#457 was closed as not planned — the scenario it was built on (an admin editing a user's email) is not a real flow, and all subscribe/unsubscribe behaviour belongs to the #438 preference model. Its v6-core side is already reverted, so everything #140 added here is dead: nothing sends Suppress Ortto contact, and nothing sends resubscribe on the sync.

What survives, and why this is a plain revert

#140 didn't only add the suppression — it also generalised #426's single-event isSyncOrttoContact check into a MUST_CONFIRM_ORTTO_EVENTS set. Reverting restores the original single-event form, which is #426's confirm-or-fail contract exactly as it shipped and ran:

  • 502 (transient) / 422 (permanent) mapping on an Ortto failure
  • the finite ORTTO_REQUEST_TIMEOUT_MS on the sync
  • forwarding Joi's coerced payload so the merge key is stable
  • the trackId-dedup bypass and the missing-payload 400

That contract is load-bearing — v6-core advances ortto_synced_email only on a 2xx, so a false success would strand a contact that was never created. I verified after the revert that all of it is still present and no trace of the suppression is.

notificationService.ts hasn't been touched since #140, so the revert applies cleanly with nothing else to preserve.

The seed is removed forward

The revert deletes 1757000000000-seedNotificationTypeSuppressOrttoContact.ts, which means that migration's own down() can no longer run — the row it created would sit in every deployed database with no code able to reach or explain it. So 1758000000000-removeNotificationTypeSuppressOrttoContact.ts deletes it instead, keeping the seed's shape-qualified WHERE (name + microService + category + schemaValidator) so a row customised through AdminJS is left alone. Its down() is deliberately a no-op: re-seeding would restore an event activityCreator can no longer build, which surfaces as a 500 rather than a working feature.

Deploy order: this must ship AFTER giveth-v6-core#482

Not because of the seeded row, but because this revert removes resubscribe from sendNotificationValidator's payload whitelist — which is strict. A v6-core still running #475 sends that key on its contact sync, so it would get a 400 on the surviving #426 sync, not just on the already-dead suppression calls. #140 carried the mirror-image note in the other direction.

giveth-v6-core#482 is already merged and deployed to staging (image staging-c611678, verified), so staging is safe to take this now.

Verification

  • tsc --noEmit clean, eslint src/ migrations/ clean.
  • notificationService.test.ts + orttoAdapter.test.ts: 26 passing.
  • Confirmed grep -rn "SUPPRESS_ORTTO\|suppress-ortto\|suppressOrtto\|resubscribe" src/ migrations/ returns nothing.
  • Confirmed the four isSyncOrttoContact / ORTTO_CONTACT_SYNC_FAILED sites are back in place.

The full suite (npm test) drops and recreates the test database, so I ran the two Ortto files standalone rather than against your local DB — worth a full run in CI.

Reverts PR #140 (merge commit 7412c12). giveth-v6-core#457 was closed as not
planned and its v6-core side is reverted in Giveth/giveth-v6-core#482, so nothing
sends this event any more: the `Suppress Ortto contact` name, its inert activity,
its Joi schema, its error message and the `resubscribe` handling on the sync were
all dead the moment that merged.

WHAT SURVIVES, and why this is a plain `git revert` rather than surgery: #140 did
not only add the suppression, it also GENERALISED #426's single-event
`isSyncOrttoContact` check into a `MUST_CONFIRM_ORTTO_EVENTS` set. Reverting
restores the original single-event form, which is #426's confirm-or-fail contract
exactly as it shipped and ran — the 502/422 mapping, the finite Ortto timeout, the
coerced-payload forwarding, the trackId-dedup bypass and the missing-payload 400.
That contract is load-bearing: v6-core advances `ortto_synced_email` only on a
2xx, so a false success there would strand a contact that was never created.
Verified after the revert — all of it is still present, and no trace of the
suppression is.

`notificationService.ts` has not been touched since #140, so the revert applies
cleanly with nothing else to preserve.

THE SEED IS REMOVED FORWARD. The revert deletes 1757000000000, which means that
migration's own down() can no longer run, so the row it created would otherwise
sit in every deployed database with no code able to reach or explain it. Instead
1758000000000 deletes it, keeping the seed's shape-qualified WHERE so a row
customised through AdminJS is left alone. Its down() is deliberately a no-op:
re-seeding would restore an event activityCreator can no longer build, which
would surface as a 500 rather than a working feature.

Deploy order does not matter this time — v6-core has already stopped sending the
event, and this only removes config nothing reads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bfed28a7-070d-4d7f-94e3-efff1fbe7f23

📥 Commits

Reviewing files that changed from the base of the PR and between 7412c12 and 9a76af3.

📒 Files selected for processing (11)
  • migrations/1757000000000-seedNotificationTypeSuppressOrttoContact.ts
  • migrations/1758000000000-removeNotificationTypeSuppressOrttoContact.ts
  • src/entities/notificationType.ts
  • src/routes/v1/notificationRouter.test.ts
  • src/services/notificationService.test.ts
  • src/services/notificationService.ts
  • src/types/general.ts
  • src/types/notifications.ts
  • src/utils/errorMessages.ts
  • src/utils/validators/segmentAndMetadataValidators.ts
  • src/validators/schemaValidators.ts
💤 Files with no reviewable changes (9)
  • src/validators/schemaValidators.ts
  • src/utils/errorMessages.ts
  • src/entities/notificationType.ts
  • src/types/general.ts
  • src/routes/v1/notificationRouter.test.ts
  • src/types/notifications.ts
  • migrations/1757000000000-seedNotificationTypeSuppressOrttoContact.ts
  • src/utils/validators/segmentAndMetadataValidators.ts
  • src/services/notificationService.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The PR removes the SUPPRESS_ORTTO_CONTACT event, its service flow, validators, error handling, tests, and seed migration. It adds a migration that deletes the existing notification type and narrows remaining Ortto handling to contact synchronization.

Changes

Ortto contact suppression removal

Layer / File(s) Summary
Event contracts and validation
src/types/general.ts, src/types/notifications.ts, src/entities/notificationType.ts, src/validators/schemaValidators.ts, src/utils/validators/segmentAndMetadataValidators.ts, src/utils/errorMessages.ts
The suppression event, Ortto mapping, validator mapping, suppression schema, resubscribe payload field, and suppression error message are removed.
Contact sync service flow
src/services/notificationService.ts, src/routes/v1/notificationRouter.test.ts, src/services/notificationService.test.ts
Confirmation, payload, timeout, deduplication, and error handling now apply only to SYNC_ORTTO_CONTACT. Suppression-specific tests are removed.
Notification type migration
migrations/1758000000000-removeNotificationTypeSuppressOrttoContact.ts
A migration deletes the matching Suppress Ortto contact row. Its rollback is a no-op.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to 9a76a

The PR removes the obsolete Ortto suppression flow while preserving the existing contact-sync failure handling. It is mergeable with explicit owner awareness that the cleanup migration cannot restore deleted configuration, so rollback to an older application version requires a separate data-restoration plan.

Suggested reviewers: ramramez

Poem

A rabbit reviewed the contact flow,
Removed the paths it no longer should know.
Sync hops onward with payload in tow,
Old suppression seeds leave below.
The migration cleans the burrow aglow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: reverting the Suppress Ortto contact event and related handling added for giveth-v6-core#457.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/457-ortto-contact-suppression

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Two corrections from review, both to comments in the new migration.

The no-op down() was justified with an inverted claim: re-seeding the row would
NOT surface as a 500. Traced through the post-revert code — `eventName` is a bare
Joi.string() so the request is accepted, the NotificationType row is found, but
`SEGMENT_METADATA_SCHEMA_VALIDATOR` no longer has a `suppressOrttoContact` entry,
so `segmentValidator` is undefined, the Ortto block's own `&& segmentValidator`
gate is falsy, activityCreator is never reached, and execution falls to the
`isOrttoSpecific` early return, which answers `{ success: true }`. So it is a
SILENT 200 for a suppression that never happened — precisely the false success the
#426 confirm-or-fail contract exists to prevent. That makes the no-op down() a
stronger decision than the original comment argued, not a weaker one.

Also recorded the deploy-order constraint, which was load-bearing and undocumented:
this must ship AFTER giveth-v6-core#482. The constraint is not about the seeded row
— it is that the revert removes `resubscribe` from `sendNotificationValidator`'s
payload whitelist, which is strict, so a v6-core still running #475 would have its
CONTACT SYNC calls 400'd, not merely its already-dead suppression calls.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ae2079
ae2079 merged commit d782984 into staging Sep 6, 2026
4 checks passed
@ae2079
ae2079 deleted the revert/457-ortto-contact-suppression branch September 6, 2026 22:53
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