修复 session_id 回绕导致的迟到事件误匹配#352
Merged
Merged
Conversation
The dictation coordinator used a wrapping u64 counter to guard delayed recorder and startup events. Replacing that guard with UUID-backed session ids removes the theoretical wraparound collision while keeping the existing stale-event comparison model. Constraint: Issue Open-Less#297 requests the UUID-based fix rather than checked arithmetic.\nRejected: checked_add with warning | still preserves a numeric boundary condition instead of eliminating the collision class.\nConfidence: high\nScope-risk: narrow\nTested: cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml\nTested: cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml coordinator::tests:: --lib\nNot-tested: Full cargo test --lib still has unrelated existing failure in types::tests::legacy_hotkey_trigger_still_produces_effective_key_codes.\nRelated: Open-Less#297
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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
概述
验证
cargo check --manifest-path openless-all/app/src-tauri/Cargo.tomlcargo test --manifest-path openless-all/app/src-tauri/Cargo.toml coordinator::tests:: --libgit diff --check说明
cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib,当前 beta 上存在无关失败:types::tests::legacy_hotkey_trigger_still_produces_effective_key_codes。本 PR 未修改types.rs。Closes #297
PR Type
Bug fix
Description
Replace wrapping u64 session_id with UUID (Uuid::new_v4)
Update all state structs and helpers to SessionId type
Adapt Windows IME prepared session slots and comparison logic
Update unit tests to use UUID-based session ids
Diagram Walkthrough
File Walkthrough
coordinator.rs
Replace u64 session_id with UUID across coordinatoropenless-all/app/src-tauri/src/coordinator.rs
SessionIdtype alias and factory functionsnew_session_id(),initial_session_id()session_idfield type inSessionResource,SessionState,QaSessionState, andPreparedWindowsImeSessionSlottoSessionIdSessionIdsession_id(n)helper, replace integer literalswith UUID-based ids