Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Summary

New organizations show "subscription required" immediately after creation because stripe_info creation is async (10-60s queue delay) while org creation is synchronous. Frontend fetches get_orgs_v7() before stripe_info exists, resulting in trial_left=0.

Solution: Poll for stripe_info creation every 3s (max 2min) when detecting new orgs (trial_left=0 && !paying && app_count=0). Show "Setting up your account" overlay instead of payment error.

Implementation

  • Organization store (src/stores/organization.ts):

    • Added isWaitingForStripeInfo() heuristic using app_count=0 to distinguish new orgs from payment failures
    • Implemented pollForStripeInfo() with localStorage persistence, timeout guards, error handling
    • Constants: POLL_INTERVAL_MS=3000, POLL_TIMEOUT_MS=120000
    • Reactive ref for timeout ensures proper Vue cleanup
  • Dashboard (src/pages/dashboard.vue):

    • New onboarding overlay with spinner when isNewOrganizationLoading=true
    • Hides payment failure modal during poll window
  • Banner (src/components/Banner.vue):

    • Suppresses billing banner during org setup
  • Translations (messages/en.json):

    • Added setting-up-account, initializing-trial, this-takes-few-seconds

Test plan

  1. Create new account → observe "Setting up your account" overlay (not payment error)
  2. Wait ~10-60s → overlay auto-dismisses when trial activates
  3. Page refresh during setup → polling resumes from localStorage timestamp
  4. Switch orgs during poll → cleanup prevents stale state

Screenshots

N/A - Requires live database trigger queue to reproduce

Checklist

  • My code follows the code style of this project and passes bun run lint:backend && bun run lint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce my tests

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • npm.jsr.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>subscription required after account created</issue_title>
<issue_description>Describe the bug/issue
When a user creates a new organization, they immediately see "subscription required" instead of their trial. This happens because:

Org creation inserts into orgs table (synchronous)
Trigger queues on_organization_create job to pgmq (async)
Frontend fetches orgs via get_orgs_v7() - but stripe_info doesn't exist yet
Since stripe_info is missing, trial_left = 0 and user sees "subscription required"
~10-60 seconds later, queue processes and creates stripe_info with trial</issue_description>

<agent_instructions>We want to fix that in the simplest manner possible. If we can change nothing in the backend, just in the frontend. If the account got just created, we don't show it this model to let the user onboarding or something like that would be nice. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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


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

Copilot AI and others added 5 commits January 19, 2026 13:42
Co-authored-by: riderx <4084527+riderx@users.noreply.github.com>
… setup

Co-authored-by: riderx <4084527+riderx@users.noreply.github.com>
…for timeout

Co-authored-by: riderx <4084527+riderx@users.noreply.github.com>
Co-authored-by: riderx <4084527+riderx@users.noreply.github.com>
Co-authored-by: riderx <4084527+riderx@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix subscription required message after account creation Fix subscription required modal on new org creation Jan 19, 2026
Copilot AI requested a review from riderx January 19, 2026 13:54
@sonarqubecloud
Copy link

@riderx
Copy link
Member

riderx commented Jan 19, 2026

@copilot not sure this would work when used in our cli, maybe we could try to direct make the stripe and then fail put in queue ? or

@riderx riderx closed this Jan 19, 2026
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.

subscription required after account created

2 participants