Skip to content

Keep streaming insertion enabled for migrated prefs#446

Merged
H-Chris233 merged 1 commit into
Open-Less:betafrom
H-Chris233:fix/issue-440-streaming-default-migration
May 15, 2026
Merged

Keep streaming insertion enabled for migrated prefs#446
H-Chris233 merged 1 commit into
Open-Less:betafrom
H-Chris233:fix/issue-440-streaming-default-migration

Conversation

@H-Chris233
Copy link
Copy Markdown
Collaborator

@H-Chris233 H-Chris233 commented May 15, 2026

User description

Summary

  • keep streaming insertion default-on for old preferences that persisted the previous default false
  • add one-time migration marker and persist normalized prefs on load
  • add release-note warning for default-on streaming insertion and clipboard sync

Tests

  • cargo test --manifest-path src-tauri/Cargo.toml --lib streaming_insert -- --nocapture
  • cargo test --manifest-path src-tauri/Cargo.toml --lib legacy_streaming_insert_false_is_migrated_and_marker_is_persisted -- --nocapture
  • npm run build
  • cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib
  • git diff --check

Closes #440


PR Type

Enhancement, Bug fix, Documentation, Tests


Description

  • Default streaming input after updates

  • Migrate legacy prefs with marker

  • Preserve manual opt-outs after migration

  • Add release-note behavior warning


Diagram Walkthrough

flowchart LR
  A["preferences.json on disk"] --> B["read_preferences"]
  B --> C["Deserialize UserPreferences"]
  C --> D["Legacy streamingInsert:false?"]
  D -- "yes" --> E["Set streaming_insert true"]
  D -- "yes" --> F["Persist migration marker"]
  D -- "no" --> G["Keep stored values"]
  E --> H["App loads preferences"]
  F --> H
  G --> H
Loading

File Walkthrough

Relevant files
Bug fix
persistence.rs
Migrate legacy streaming prefs on load                                     

openless-all/app/src-tauri/src/persistence.rs

  • Adds read_preferences to migrate legacy preference files.
  • Persists normalized prefs when migration marker is missing.
  • Logs success or failure for marker persistence.
  • Adds a regression test for legacy streamingInsert:false.
+80/-3   
Enhancement
types.rs
Add streaming migration marker to preferences                       

openless-all/app/src-tauri/src/types.rs

  • Introduces streaming_insert_default_migrated on UserPreferences.
  • Defaults missing or legacy streamingInsert to enabled.
  • Preserves explicit post-migration false values.
  • Updates serde wiring and adds unit tests.
+61/-2   
ipc.ts
Sync mocked preferences shape with backend                             

openless-all/app/src/lib/ipc.ts

  • Adds streamingInsertDefaultMigrated to mock settings.
  • Keeps frontend test and IPC data aligned with backend schema.
+1/-0     
types.ts
Document streaming default-on preference                                 

openless-all/app/src/lib/types.ts

  • Adds streamingInsertDefaultMigrated to the TS interface.
  • Updates the streamingInsert docs to default-on behavior.
  • Mirrors backend preference schema changes for the UI.
+4/-1     
Tests
stylePrefs.test.ts
Update style preference test fixture                                         

openless-all/app/src/lib/stylePrefs.test.ts

  • Adds the new migration marker to test preferences.
  • Keeps the fixture compatible with updated UserPreferences.
+1/-0     
Documentation
release-tauri.yml
Add release notes for default-on streaming                             

.github/workflows/release-tauri.yml

  • Appends release-note text about streaming input defaulting on.
  • Notes clipboard sync behavior as part of the change.
  • Warns users about the new default behavior in releases.
+5/-0     

Older builds could persist the old default streamingInsert=false into preferences.json, which is indistinguishable from a user opt-out if the value is treated as an ordinary bool. Add a one-time migration marker, persist normalized legacy prefs on load, and keep later user opt-outs durable after migration.

Constraint: issue Open-Less#440 requests streaming input/output defaults on for fresh installs and updates, plus release notes for the behavior change.

Rejected: treating any stored false as manual opt-out | old default writes would keep update users off forever.

Rejected: overriding every false forever | would erase a user's post-migration manual opt-out.

Confidence: high

Scope-risk: moderate

Directive: Keep UserPreferencesWire serde defaults and migration markers aligned with persisted UserPreferences fields.

Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib streaming_insert -- --nocapture

Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib legacy_streaming_insert_false_is_migrated_and_marker_is_persisted -- --nocapture

Tested: npm run build

Tested: cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib

Tested: git diff --check

Not-tested: cargo fmt --check fails on pre-existing unrelated formatting drift in volcengine.rs and commands.rs.
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

440 - Partially compliant

Compliant requirements:

  • 更新后默认开启 streaming_insert
  • 区分旧配置默认值与手动关闭,并持久化迁移标记
  • 在 release notes 中增加行为变更提示

Non-compliant requirements:

  • 暂未能仅凭代码确认“流式输出”对应的具体配置项是否就是 streaming_insert_save_clipboard

Requires further human verification:

  • 需要人工确认“流式输出”的产品映射是否与 streaming_insert_save_clipboard 完全一致
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@H-Chris233 H-Chris233 merged commit 1ab231d into Open-Less:beta May 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[需求] 新装/更新后默认开启「流式输入」+「流式输出」

1 participant