2code icon indicating copy to clipboard operation
2code copied to clipboard

replace_profile_workspace leaves session workspace_id stale (Task 8 gap)

Open AkaraChen opened this issue 2 months ago • 1 comments

Summary

Parent: #394 / #417. Found while reviewing runtime mapping (#414) on task-7-runtime-mapping. Implemented on task-8-profile-adoption (commit 27ea6b4). Close this issue when that branch lands.

replace_profile_workspace used to update only profile_runtime_mappings.workspace_id. require_session_workspace_matches_profile ran on bind_session_pane / replace_session_pane, not on profile replace. Existing session_runtime_mappings rows for that profile kept the old workspace_id.

This did not block accepted #414. It did block Task 8 adoption until task-8-profile-adoption unbound those session rows so both mappings’ workspace_id stay consistent.

Implemented on task-8-profile-adoption

  • replace_profile_workspace (lines 179–219) calls unbind_session_mappings_for_profile before writing a new workspace_id
  • Same-id replace returns the existing row and does not unbind
  • Tests: profile_replace_unbinds_stale_session_workspace_ids in runtime_mapping.rs; adoption coverage in runtime_adoption.rs

Do not treat remaining Task 8 replace-integrity work as open. Session→pane bind is implemented on Task 9 (task-9-terminal-lifecycle, #419).

AkaraChen avatar Sep 15 '26 10:09 AkaraChen

Verified on tip task-1-verify-gaps. Mapping tables and replace_profile_workspace are gone; this defect cannot happen.

  • No runtime_mapping.rs in the tree.
  • src-tauri/crates/service/src/runtime/herdr.rs:2414 asserts replace_profile_workspace absent.
  • src-tauri/crates/service/src/profile.rs herdr_profile_create_does_not_use_forbidden_ops also asserts replace_profile_workspace absent.
  • sqlite profiles / mapping tables are DROPped (db::tests::drop_profiles_migration_removes_mapping_tables).

Closing as superseded by dropped mapping tables, not by re-adding them.

AkaraChen avatar Sep 16 '26 19:09 AkaraChen