Skip to content

Conversation

@riderx
Copy link
Member

@riderx riderx commented Jan 8, 2026

Summary

  • Adds Electron as a supported platform alongside iOS and Android
  • Channels can now enable/disable Electron updates independently
  • Frontend settings toggle for Electron platform control

Changes

  • SQL Migration: Adds electron to platform_os enum, channels.electron column
  • Backend: Platform validation in update.ts, channel_self.ts, create_device.ts, build/*
  • Frontend: Electron toggle in channel settings page
  • Tests: New test cases for Electron platform in cli-channel.test.ts, channel_self.test.ts, updates.test.ts
  • Replicas: Updated planetscale/schema_replicate.sql for sync
  • Seed data: Updated channel inserts with electron column

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Warning

Rate limit exceeded

@riderx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 13 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f3a1c81 and d7f2fe6.

📒 Files selected for processing (26)
  • .opencode/worktree-session-state.json
  • messages/en.json
  • planetscale/schema_replicate.sql
  • src/components/dashboard/AppSetting.vue
  • src/components/dashboard/DeploymentBanner.vue
  • src/components/tables/LogTable.vue
  • src/pages/app/[package].channel.[channel].devices.vue
  • src/pages/app/[package].channel.[channel].history.vue
  • src/pages/app/[package].channel.[channel].vue
  • src/types/supabase.types.ts
  • supabase/functions/_backend/plugins/channel_self.ts
  • supabase/functions/_backend/plugins/updates.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/public/build/request.ts
  • supabase/functions/_backend/public/build/status.ts
  • supabase/functions/_backend/utils/cloudflare.ts
  • supabase/functions/_backend/utils/pg.ts
  • supabase/functions/_backend/utils/postgres_schema.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/utils/supabase.types.ts
  • supabase/functions/_backend/utils/update.ts
  • supabase/migrations/20260108000000_add_electron_platform.sql
  • supabase/seed.sql
  • tests/channel_self.test.ts
  • tests/cli-channel.test.ts
  • tests/updates.test.ts

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 and usage tips.

@riderx riderx requested a review from Copilot January 8, 2026 03:41
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f7db5da65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +254 to +256
const combinedOptions = computed(() => channels.value.filter(channel => channel.ios && channel.android && channel.electron))
const iosSingleOptions = computed(() => channels.value.filter(channel => channel.ios && !channel.android && !channel.electron))
const androidSingleOptions = computed(() => channels.value.filter(channel => channel.android && !channel.ios && !channel.electron))

Choose a reason for hiding this comment

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

P2 Badge Allow iOS+Android defaults when Electron is disabled

The new option filters only treat a channel as “combined” if ios && android && electron, and they only treat a channel as a split option if it supports exactly one platform. That means a channel configured for iOS+Android with electron = false is excluded from both the combined and split lists, so the default download channel dialog can report “no compatible download channel” and there is no way to select (or keep) that valid iOS/Android default without re‑enabling Electron or creating extra channels. This is a regression for users who intentionally disable Electron updates but still want a single channel for iOS+Android.

Useful? React with 👍 / 👎.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive support for Electron as a third platform alongside iOS and Android across the entire Capgo live update stack. Channels can now independently enable/disable Electron updates, and devices using the Electron platform will be properly tracked and served updates based on channel configuration.

Key changes:

  • Database schema extended with electron column on channels table and electron enum value for platform_os
  • Backend platform validation updated across all update endpoints to recognize and handle Electron
  • Frontend channel configuration UI enhanced with Electron toggle and multi-platform selection logic
  • Analytics and device tracking extended to capture Electron platform data

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
supabase/migrations/20260108000000_add_electron_platform.sql Adds electron to platform_os enum, channels.electron column, indexes, and build constraints
supabase/seed.sql Updates channel inserts to include electron column with default true value
planetscale/schema_replicate.sql Mirrors electron column addition for PlanetScale replica sync
supabase/functions/_backend/utils/supabase.types.ts Adds electron to platform_os enum and stats_action types
supabase/functions/_backend/utils/postgres_schema.ts Adds electron boolean column to channels schema definition
supabase/functions/_backend/utils/pg.ts Updates channel query functions to include electron in selects and platform filtering
supabase/functions/_backend/utils/update.ts Adds platform validation check for disabled electron updates
supabase/functions/_backend/utils/cloudflare.ts Extends device tracking to support electron platform (value 2) in Analytics Engine
supabase/functions/_backend/utils/supabase.ts Updates recordBuildTime signature to accept electron platform
supabase/functions/_backend/plugins/updates.ts Adds electron to platform validation schema
supabase/functions/_backend/plugins/channel_self.ts Updates platform schema and channel filtering logic to support electron
supabase/functions/_backend/private/create_device.ts Extends platform enum to include electron in device creation
supabase/functions/_backend/public/build/status.ts Adds electron to platform type definition
supabase/functions/_backend/public/build/request.ts Adds electron platform validation for build requests
src/types/supabase.types.ts Frontend type definitions mirroring backend changes
src/pages/app/[package].channel.[channel].vue Adds Electron toggle to channel settings UI
src/pages/app/[package].channel.[channel].history.vue Includes electron in channel data queries
src/pages/app/[package].channel.[channel].devices.vue Includes electron in channel data queries
src/components/tables/LogTable.vue Adds electron platform filter for action logs
src/components/dashboard/DeploymentBanner.vue Extends deployment logic to handle electron platform combinations
src/components/dashboard/AppSetting.vue Comprehensive updates for electron in download channel configuration
messages/en.json Adds electron-related translation keys and updates platform descriptions
tests/updates.test.ts Adds test verifying electron platform is accepted
tests/cli-channel.test.ts Adds tests for setting electron platform and multi-platform channels
tests/channel_self.test.ts Adds test for electron platform compatibility (needs completion)
.opencode/worktree-session-state.json Session state file (should not be committed)

Comment on lines +343 to +358
it('[GET] should return compatible channels for Electron', async () => {
await resetAndSeedAppData(APPNAME)

const data = getBaseData(APPNAME)
data.platform = 'electron'
data.is_emulator = false
data.is_prod = true
const response = await fetchGetChannels(data as any)

expect(response.ok).toBe(true)
const json = await response.json() as ChannelsListResponse

expect(json).toBeDefined()
expect(Array.isArray(json)).toBe(true)
// Electron should get channels that have electron=true
})
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

This test case for Electron platform compatibility is incomplete. It verifies the response is successful and that json is an array, but doesn't actually assert which channels should be returned (unlike the iOS and Android tests which check specific channel names and lengths). The comment on line 357 acknowledges this but the assertions should be completed. Based on the seed data, Electron should have electron=true for all channels, so you should verify the expected channels are returned (similar to lines 336-340 for Android).

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

"channel-not-found-description": "This channel could not be found. It might have been deleted or you might not have access to it.",
"channel-platform-android": "Android only",
"channel-platform-both": "iOS & Android",
"channel-platform-both": "iOS & Android & Electron",
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The translation key "channel-platform-both" was changed from "iOS & Android" to "iOS & Android & Electron". This is potentially a breaking change if this key is used to represent channels that support both iOS and Android but not necessarily Electron. Consider either keeping the original translation and adding a new "channel-platform-all" key for three-platform support, or ensure all places using this key are updated to handle the three-platform scenario appropriately.

Suggested change
"channel-platform-both": "iOS & Android & Electron",
"channel-platform-both": "iOS & Android",
"channel-platform-all": "iOS & Android & Electron",

Copilot uses AI. Check for mistakes.
Comment on lines 23 to 32
"ses_46ba2f84effe4l1eoBWyYUSSox": {
"sessionId": "ses_46ba2f84effe4l1eoBWyYUSSox",
"createdAt": 1767720683481
},
"ses_464e51423ffeWTlQdvv79ZZB7q": {
"sessionId": "ses_464e51423ffeWTlQdvv79ZZB7q",
"createdAt": 1767833791500
}
}
}
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

This file appears to be an internal session state file that should not be committed to the repository. It contains session-specific data that changes frequently and is not part of the application code. Consider adding this file to .gitignore if it isn't already.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI commented Jan 8, 2026

@riderx I've opened a new pull request, #1386, to work on those changes. Once the pull request is ready, I'll request review from you.

@riderx
Copy link
Member Author

riderx commented Jan 8, 2026

@copilot in this pull request, we want to be sure that the user can have:

  1. One default channel
  2. Three default channels
  3. One combined or separate one
    The rule and everything the backend should check it properly, and you should have tests for that to ensure we cannot have more than three. And we cannot have two Electron and one iOS; it should be like one of each maximum.

Copy link

Copilot AI commented Jan 8, 2026

@riderx I've opened a new pull request, #1387, to work on those changes. Once the pull request is ready, I'll request review from you.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 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.

2 participants