-
-
Notifications
You must be signed in to change notification settings - Fork 130
fix(api): JWT notifications auth + builtin kill-switch revert #2805
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?
Changes from all commits
f9a86fd
dcdda3c
671e805
e7569aa
1c68bca
a8e30a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -665,14 +665,15 @@ export async function updateWithPG( | |
| } | ||
| } | ||
| if (version.name === 'builtin' && greaterOrEqual(parse(plugin_version), parse('6.2.0'))) { | ||
| if (body.version_name === 'builtin' && version.name === 'builtin') { | ||
| // plugin_parser rewrites version_name "builtin" -> version_build, so we cannot | ||
| // compare version_name === "builtin" here. Store binary => names match build; | ||
| // OTA bundle => version_name is the live bundle and differs from version_build. | ||
| if (version_name === version_build) { | ||
| return updateError200(c, 'already_on_builtin', 'Already on builtin') | ||
| } | ||
| else { | ||
| return updateError200(c, 'already_on_builtin', 'Already on builtin', { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Matching OTA semver skips kill-switchMedium Severity For a built-in channel, Reviewed by Cursor Bugbot for commit a8e30a7. Configure here. |
||
| version: 'builtin', | ||
| }) | ||
| } | ||
| // Kill-switch: tell plugin to reset to the store binary (no error/kind). | ||
| await sendStatsAndDevice(c, device, [{ action: 'get', versionName: 'builtin' }]) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Devices can remain on the OTA bundle when the stats/device side effect fails, because the awaited Prompt for AI agents |
||
| return c.json({ version: 'builtin' }, 200) | ||
| } | ||
| else if (version.name === 'builtin' && !greaterOrEqual(parse(plugin_version), parse('6.2.0'))) { | ||
| return updateError200(c, 'revert_to_builtin_plugin_version_too_old', 'revert_to_builtin used, but plugin version is too old') | ||
|
|
||


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.
P2: The kill-switch check
version_name === version_buildcan also match a device that is still running an OTA bundle whose semver happens to equal the native build version (a common case when bundle and native versions are kept in sync). In that scenario the endpoint returnsalready_on_builtininstead of{ version: 'builtin' }, so the plugin never enters its reset-to-store-binary path even though the channel has reverted to built-in. Consider distinguishing “on OTA bundle” vs “on native binary” using a signal other than semver equality (e.g. whether a bundle id/version is actually installed) before short-circuiting toalready_on_builtin.Prompt for AI agents