Skip to content

fix(gmail): paywall additional inboxes, keep first inbox free#4280

Open
gbirman wants to merge 1 commit into
mainfrom
gbirman/macro-2003-multi-inbox-account-linking-check-if-user-already-has-an-account-linked-before-paywall
Open

fix(gmail): paywall additional inboxes, keep first inbox free#4280
gbirman wants to merge 1 commit into
mainfrom
gbirman/macro-2003-multi-inbox-account-linking-check-if-user-already-has-an-account-linked-before-paywall

Conversation

@gbirman

@gbirman gbirman commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Restores the professional-subscription gate on /link/gmail that #4277 removed, but only paywalls when the user already has an inbox — so free users can still link their first inbox. Supersedes #4277's blanket removal with the proper "first inbox free" gating, and adds a unit test safeguarding the decision.

Macro task: https://macro.com/app/task/019ef4c3-ac39-79b1-83ff-e0b19c520cd8

@macro-application

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7fcc0e47-a60e-497c-8dad-a274fa708ae0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The Gmail inbox-link initialization handler (init_gmail_link_handler) is updated to enforce a paywall for linking additional inboxes. The handler now extracts user permissions, computes whether the user has professional features, and queries the database for existing inbox ownership when the user is not pro. A new private helper, requires_professional_subscription, encapsulates the paywall decision—returning true only when the user lacks professional features and already owns an inbox—and returns PaymentRequired in that case. Imports are consolidated, a #[allow(dead_code)] attribute is removed, and a test module with three unit tests covering all input combinations is added.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format (fix:), is 61 characters (under 72), and clearly describes the main change: implementing a paywall for additional Gmail inbox links while keeping the first inbox free.
Description check ✅ Passed The description is directly related to the changeset, explaining the restoration of professional-subscription gating with conditional logic for first inbox free, and references the superseded PR and added tests.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@gbirman gbirman marked this pull request as draft June 23, 2026 16:13
@gbirman gbirman force-pushed the gbirman/macro-2003-multi-inbox-account-linking-check-if-user-already-has-an-account-linked-before-paywall branch from 7164ddb to d80e8ab Compare June 23, 2026 16:15
Restore the professional-subscription gate on /link/gmail but only when the
user already has an inbox, so a free user can link their first inbox. Adds a
unit test covering the gating decision.
@gbirman gbirman force-pushed the gbirman/macro-2003-multi-inbox-account-linking-check-if-user-already-has-an-account-linked-before-paywall branch from d80e8ab to c1efbba Compare June 23, 2026 16:22
@gbirman gbirman marked this pull request as ready for review June 23, 2026 16:25
@whutchinson98 whutchinson98 self-requested a review June 23, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant