fix(types): align TS UserPreferences with Rust update_channel#386
Merged
H-Chris233 merged 1 commit intobetafrom May 9, 2026
Merged
fix(types): align TS UserPreferences with Rust update_channel#386H-Chris233 merged 1 commit intobetafrom
H-Chris233 merged 1 commit intobetafrom
Conversation
Rust types.rs declares pub update_channel: UpdateChannel, but the TS UserPreferences interface in src/lib/types.ts and the mockSettings fixture in src/lib/ipc.ts both omitted the field. setSettings() round-trips were lossless only because Rust's serde(default) refilled the field, but consumers that destructured UserPreferences would silently miss it. - Move UpdateChannel type from ipc.ts to types.ts (avoids ipc <-> types circular import); ipc.ts re-exports for backward compat with SettingsModal etc. - Add updateChannel: UpdateChannel to UserPreferences interface. - Add updateChannel: 'stable' to mockSettings fixture. - Update stylePrefs.test.ts fixture for new required field. Audit ID 2.2.1 (docs/audit-2026-05-10-validated.md, kept local).
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
5 tasks
pull Bot
pushed a commit
to yimmy23/openless
that referenced
this pull request
May 10, 2026
10 PRs landed on beta this cycle: - Open-Less#377 paste shortcut configurable (issue Open-Less#360) - Open-Less#386 TS UserPreferences updateChannel alignment - Open-Less#387 focus_target leak on Processing-phase cancel - Open-Less#388 [严重] MacHotkeyAdapter::shutdown stops CFRunLoop + tap - Open-Less#389 emit_capsule window.show/hide off audio thread - Open-Less#390 QA / dictation hotkey routing race - Open-Less#391 audio-mute spawn_blocking (async hygiene) - Open-Less#392 hotkey supervisor + global dispatcher exit signal - Open-Less#393 post-audit logic-review hotfixes (QA mute .await + focus_target Processing branch) - Open-Less#394 in-process credentials cache (kills repeated Keychain prompts) Bump 4 files: package.json, tauri.conf.json, Cargo.toml, Cargo.lock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Rust
types.rsdeclarespub update_channel: UpdateChannelonUserPreferences, but the TS interface insrc/lib/types.tsandmockSettingsinsrc/lib/ipc.tsboth omitted it.setSettings()round-trips were lossless only because Rust'sserde(default)refilled the field, so today's behavior is unaffected — but TS consumers that destructureUserPreferencessilently miss the field, and the type was lying about what the backend serializes.Changes
UpdateChanneltype fromipc.tstotypes.ts(avoidsipc <-> typescircular import).ipc.tsre-exportsUpdateChannelfor backward compat —SettingsModal.tsxand any other module still imports fromipc.tsunchanged.updateChannel: UpdateChanneltoUserPreferencesinterface.updateChannel: 'stable'tomockSettingsand to thestylePrefs.test.tsfixture (otherwise tsc fails).Audit linkage
Audit ID 2.2.1 of the 2026-05-10 audit set (CONFIRMED). See
docs/audit-2026-05-10-validated.md(local, not in repo) for the full validation context.Test plan
npx tsc --noEmitclean (was failing onstylePrefs.test.tsfor missing field — now fixed)npm run build— to be verified in CIgetUpdateChannel/setUpdateChannelIPC (unchanged)Awaiting manual verification: this is a TS-only change; Rust round-trip behavior is identical.
PR Type
Bug fix, Tests
Description
Add
updateChannelfield to TSUserPreferencesto match Rust backendMove
UpdateChanneltype fromipc.tstotypes.tsto avoid circular importsUpdate
mockSettingsand test fixture with new required fieldRe-export
UpdateChannelfromipc.tsfor backward compatibilityDiagram Walkthrough
File Walkthrough
types.ts
Define UpdateChannel type and add updateChannel to UserPreferencesopenless-all/app/src/lib/types.ts
UpdateChanneltype definition (moved from ipc.ts)updateChannel: UpdateChannelproperty toUserPreferencesinterface
ipc.ts
Refactor UpdateChannel import and update mockSettingsopenless-all/app/src/lib/ipc.ts
UpdateChannelfrom./typesinstead of defining inlineUpdateChannelfor backward compatibilityupdateChannel: 'stable'tomockSettingsfixturestylePrefs.test.ts
Add updateChannel to test fixtureopenless-all/app/src/lib/stylePrefs.test.ts
updateChannel: 'stable'topreviousPrefstest fixture to matchnew interface requirement