Updates Module
Desktop app release management and gradual rollout
The Updates module serves desktop app update information and manages release records. Source: packages/server/src/modules/updates/.
REST Endpoints
All endpoints are prefixed with /api/v1/updates.
| Method | Path | Guards | Description |
|---|---|---|---|
| GET | /updates/check | None | Check for an available update |
| POST | /updates | ClerkAuthGuard + @Roles('OWNER', 'ADMIN') | Publish a new release |
| PATCH | /updates/:id | ClerkAuthGuard + @Roles('OWNER', 'ADMIN') | Update release settings |
| GET | /updates/releases | ClerkAuthGuard + @Roles('OWNER', 'ADMIN') | List releases (admin) |
Update Check
GET /api/v1/updates/check is the endpoint polled by the desktop UpdateManager.
Query params:
| Param | Description |
|---|---|
version | Current installed version |
platform | darwin / win32 / linux |
arch | x64 / arm64 / universal |
channel | stable / beta / canary (default: stable) |
clientId | Stable per-device ID for rollout bucketing |
Response when an update is available:
{
updateAvailable: true;
currentVersion: string;
latestVersion: string;
mandatory?: boolean;
releaseNotes?: string;
downloadUrl?: string;
signature?: string;
fileSizeBytes?: number;
sha512?: string;
channel?: string;
publishedAt?: string;
}Response when no update:
{ updateAvailable: false; currentVersion: string }Rollout Bucketing
The rolloutPercentage field (0–100) controls gradual rollouts. The clientId is hashed deterministically to a number 0–99. If the hash falls within [0, rolloutPercentage), the update is served to that device.
This means:
rolloutPercentage: 0— no devices receive the updaterolloutPercentage: 10— ~10% of devices receive the updaterolloutPercentage: 100— all devices receive the update
Updates Service (services/updates.service.ts)
checkForUpdate(query)
- Queries
AppReleasefor the latestactive: truerelease matchingplatform,arch, andchannel. - Compares the release version against the client's
version. - Applies rollout bucket check using
clientId. - Returns the update payload or
{ updateAvailable: false, currentVersion }.
Admin endpoints (repository-direct)
The POST /updates, PATCH /updates/:id, and GET /updates/releases endpoints are admin-only (require ClerkAuthGuard + OWNER/ADMIN role). They call UpdatesRepository directly — there are no publishRelease or updateRelease service methods.
AppRelease Schema
| Field | Type | Description |
|---|---|---|
version | string | Semver (e.g. "2026.4.30") |
platform | DARWIN | WIN32 | LINUX | Target platform |
arch | X64 | ARM64 | UNIVERSAL | CPU architecture |
channel | STABLE | BETA | CANARY | Release channel |
downloadUrl | string | Direct download URL |
sha512 | string? | SHA-512 of the installer file |
fileSizeBytes | int? | File size in bytes |
releaseNotes | string? | Markdown release notes |
minOsVersion | string? | Minimum OS version |
signature | string? | Code signature |
mandatory | boolean | Force update if true |
rolloutPercentage | int | 0–100 rollout target |
active | boolean | Whether this release is served |
publishedAt | DateTime | Publish timestamp |