feat: prepare Loops migration and shared email library - #2272
Merged
Conversation
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
richiemcilroy
marked this pull request as ready for review
September 11, 2026 15:56
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bento's external signup sequence can send upgrade emails to existing customers and people joining another organization. This prepares separate Loops journeys for independent free users, customers, teammates and former customers. Paid/license evidence, downstream audience checks and persistent teammate classification stop sales follow-ups after an invite or purchase. Teammates receive workspace help only, including existing accounts accepting a new invite after cutover.
Normal completed Cap signups create or reuse a Stripe customer; the native Loops integration imports customer creation and updates. Cap enriches that contact with current audience, greeting, plan and recording milestones through a durable
loops_sync_jobsqueue and an authenticated every-minute cron. SSO uses a held direct-create fallback. Transactional queue writes, expiring leases, revisions and retry backoff preserve work through interruptions and concurrent changes. Changed/deleted identities are held for reconciliation.There is no
marketing_contactstable or separate consent-capture step. Loops owns global and list preferences; routine enrichment never resubscribes or changes list membership. A missing list entry holds enrollment. Historical imports remain held, missing previously synced contacts are not recreated, and existing opt-outs/suppressions take precedence. The unshipped consent-table migration was replaced using Drizzle tooling with the origin field and delivery queue migrations; apply schema before deploying code.The
emails/library owns all 12 marketing messages, shared branding, sender defaults, customer variations, audiences and flow definitions. Its generated catalogue shows four journeys, two campaign templates, timing, branches, copy and existing Resend send sources. The custom MJML uses the actual Cap logo artwork, complete greetings (Hey,without a name), consistent spacing and one compact company/address/unsubscribe footer. Existing Resend application mail is unchanged.Loops' beta API cannot read custom MJML. The legacy provisioner refuses writes to these managed emails, and
emails:check-loops --structure-onlyverifies graphs, filters, draft state and custom format. Changed content requires browser review and reconciliation to local source. Catalogue excerpts strip only allowlisted formatting tags and escape remaining markup; malformed and full-script regressions cover the CodeQL finding.An independent GitHub Actions check reads an authenticated Cap queue-health endpoint. Unhealthy or unavailable sync holds all four downstream journey guards, and recovery requires an explicit healthy resume. Newly queued changes bypass an older attempt's backoff, and unchanged successful refreshes clear old failures. The check is disabled pending deployment/configuration; GitHub delays and Loops API outages can prevent a timely hold. Scheduled campaigns require separate manual health checks and cancellation.
Validation:
db:pushhit an unrelated storage prefix-index quoting bug; exact generated Loops SQL was applied and verified on the empty branch. The additive generated schema is now applied to production through PlanetScale deploy request Can't select which screen to record #94 and independently verified; the new queue was empty before code rollout.Native Stripe contact syncing is enabled. Production schema is applied. Vercel is configured for owned-address test mode, enrollment is disabled, and the code remains undeployed pending merge. GitHub requires one approving review. GitHub watchdog credentials are prepared; its enable flag remains absent. Before activation: reconcile the final Bento suppression delta, deploy in owned-address test mode, prove the deployed signup/purchase/invite/opt-out paths and sync latency, enable and test the independent delivery check and its notifications, and check Resend/Bento overlap. Loops uses the last synced properties during an outage;
capVerifiedAtis not an automatic expiry rule. Activation and Bento shutdown require the explicit cutover described inscripts/loops/README.md.Private exports, credentials, recipient data and detailed test receipts remain outside Git. Cross-client dark-mode rendering and future inbox placement have not been exhaustively established.
The PR appears safe to merge based on the reviewed changes, with no outstanding actionable findings.
Summary
Reviews (8) · Last reviewed commit: "fix: preserve absent Loops mailing list ..."