Skip to content

fix(app-store): preserve existing enabled state during seed#27918

Merged
sahitya-chandra merged 2 commits intocalcom:mainfrom
devanshu0x:fix/seed-preserve-enabled-state
Feb 13, 2026
Merged

fix(app-store): preserve existing enabled state during seed#27918
sahitya-chandra merged 2 commits intocalcom:mainfrom
devanshu0x:fix/seed-preserve-enabled-state

Conversation

@devanshu0x
Copy link
Copy Markdown
Contributor

@devanshu0x devanshu0x commented Feb 13, 2026

What does this PR do?

This PR fixes an issue where apps (e.g. Google Calendar / Google Meet) were being unintentionally disabled during Docker restarts or database reseeding.

Problem

When scripts/seed-app-store.ts runs, it recalculates the enabled flag for every app using shouldEnableApp.
On subsequent runs, if keys were undefined or validation logic behaved differently, the app's enabled field could be set to false , even if it was previously configured and working correctly.

The main issue I found is this loop in scripts/seed-app-store.ts

for (const [, app] of Object.entries(appStoreMetadata)) {
    if (app.isTemplate && process.argv[2] !== "seed-templates") {
      continue;
    }

    const validatedCategories = app.categories.filter(
      (category): category is AppCategories => category in AppCategories
    );

    await createApp(
      app.slug,
      app.dirName ?? app.slug,
      validatedCategories,
      app.type,
      undefined,   // keys are passed as undefined
      app.isTemplate
    );
  }
}

This loop overrides the apps enabled flag to be false

This caused integrations to appear randomly disabled on self-hosted Docker instances after restart.

Solution

Preserve the existing enabled state if no new keys are provided.

What Was Tested

  • Tested locally using Docker self-host setup.
  • Configured Google Calendar integration with valid OAuth credentials.
  • Verified enabled = true in the database.
  • Restarted containers multiple times.
  • Confirmed that enabled no longer flips to false.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. (N/A)
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Reproduction (Before Fix)

  • Self-host using Docker.
  • Configure Google Calendar integration.
  • Confirm enabled = true in DB.
  • Restart Docker (docker compose restart calcom).
  • Observe that enabled becomes false.

Verification (After Fix)

  • Apply this PR.
  • Configure Google Calendar integration.
  • Restart Docker.

Confirm:

  • enabled remains true
  • Integration remains visible and usable.

Environment Variables

Ensure relevant integration credentials are set (e.g. Google OAuth keys) when testing validation logic.

Expected Behavior

  • Seeding should not disable existing apps.
  • enabled state should only change when explicitly revalidated with new keys.

Open with Devin

@github-actions github-actions bot added the 🐛 bug Something isn't working label Feb 13, 2026
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 13, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="scripts/seed-app-store.ts">

<violation number="1" location="scripts/seed-app-store.ts:53">
P1: Default apps without API keys (apple-calendar, jitsi, caldav-calendar) will be disabled on fresh installations due to incorrect fallback logic</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@devanshu0x devanshu0x force-pushed the fix/seed-preserve-enabled-state branch from 7e10835 to 956e37e Compare February 13, 2026 06:54
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 13, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@sahitya-chandra sahitya-chandra added the run-ci Approve CI to run for external contributors label Feb 13, 2026
@sahitya-chandra sahitya-chandra enabled auto-merge (squash) February 13, 2026 08:28
@sahitya-chandra sahitya-chandra merged commit 1541730 into calcom:main Feb 13, 2026
104 of 115 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync ready-for-e2e run-ci Approve CI to run for external contributors size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apps Are Being Disabled Due to App Validation Function

3 participants