-
-
Notifications
You must be signed in to change notification settings - Fork 67
feat: add Electron platform support for channels #1383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
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 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. 📒 Files selected for processing (26)
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. Comment |
There was a problem hiding this 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".
| 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 👍 / 👎.
There was a problem hiding this 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
electroncolumn on channels table andelectronenum 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) |
| 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 | ||
| }) |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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", |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
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.
| "channel-platform-both": "iOS & Android & Electron", | |
| "channel-platform-both": "iOS & Android", | |
| "channel-platform-all": "iOS & Android & Electron", |
| "ses_46ba2f84effe4l1eoBWyYUSSox": { | ||
| "sessionId": "ses_46ba2f84effe4l1eoBWyYUSSox", | ||
| "createdAt": 1767720683481 | ||
| }, | ||
| "ses_464e51423ffeWTlQdvv79ZZB7q": { | ||
| "sessionId": "ses_464e51423ffeWTlQdvv79ZZB7q", | ||
| "createdAt": 1767833791500 | ||
| } | ||
| } | ||
| } |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <[email protected]>
|
@copilot in this pull request, we want to be sure that the user can have:
|
|



Summary
Changes
electrontoplatform_osenum,channels.electroncolumnupdate.ts,channel_self.ts,create_device.ts,build/*cli-channel.test.ts,channel_self.test.ts,updates.test.tsplanetscale/schema_replicate.sqlfor sync