Skip to content

fix(windows): hold sign-out for unsaved work, split long secrets, close late sessions - #4216

Merged
datlechin merged 2 commits into
mainfrom
fix/audit-w6-windows-core
Nov 12, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/audit-w6-windows-core

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • WD-1: a form save that changes a field the connect reads, or a secret, restarts a connect still under way, so the new Safe Mode reaches the session.
  • WD-1: a rename, colour or group change leaves a connect under way alone.
  • WD-2: while a tab holds a transaction or unsaved table changes, the app registers a ShutdownBlockReasonCreate reason and answers WM_QUERYENDSESSION with FALSE, so sign-out and restart wait for the user.
  • WD-2: the session file is written before that answer.
  • WD-2: a forced end (Sign out anyway, a forced Restart Manager close) still closes the app, as the Restart Manager docs say.
  • WD-3: a session that arrives after Disconnect, or after its connect was cancelled or started over, is closed, not adopted.
  • WD-4: Edit connection then Connect drops the hidden spare window first, so the old session closes.
  • WD-4: closing a tab window drops a spare that holds its session.
  • WD-5: Refresh cancels an object tree load still running, so folders show once.
  • CR-2: a secret over 2,560 bytes is split over <name>/1, <name>/2 in Credential Manager.
  • CR-2: each part carries a TablePro_Parts attribute, so a write cut short reads as no secret, never a mix.
  • CR-2: the credential comment is cut to 255 characters; secrets stored before read unchanged.
  • The core stores a password typed at connect with Save ticked once it logs in (connect_saved takes keep), under the library's write lock.
  • It is dropped when the record no longer connects like the one the connect read, or a secret was saved since.
  • Bindings regenerated; ADR 0004 and core/ARCHITECTURE.md updated.

Test plan

  • TablePro.App.Model.Tests: new ConnectionLifeTests (session after disconnect, restart during a connect, save after cancel, restart only while connecting), ConnectionDraftTests.ARenameLeavesAConnectUnderWayAndAnythingItReadsStartsItOver, WorkspaceTabsTests pending work.
  • Changed on purpose: ASecretWithNoneSavedIsAskedForAndSavedOnceTheConnectWorks (now ...KeptByTheConnectThatLogsInWithIt) and ASecretRefusedAgainFailsAndAClosedQuestionCancelsTheConnect assert what the connect asks the core to keep.
  • TablePro.Interop.Tests: ConnectionLibraryTests.ATypedPasswordToKeepIsStoredOnceItLogsIn.
  • cargo test -p tablepro-ffi: credential_parts, a_secret_a_connect_proved_is_kept_only_while_nothing_was_saved_since, a_typed_secret_is_kept_once_its_connect_logs_in_and_not_when_it_fails.
  • Windows-only Credential Manager tests: a 3,281-character token and an exact 2,560-byte secret.
  • The shutdown block, spare drop and tree cancel are in TablePro.App, which the Windows runners build and UI-test.

…core

# Conflicts:
#	core/crates/ffi/src/core_handle.rs
#	core/crates/ffi/src/lib.rs
#	windows/src/TablePro.Interop/Generated/tablepro_ffi.cs
@datlechin
datlechin enabled auto-merge (squash) November 12, 2026 05:27
@datlechin
datlechin merged commit a88ae32 into main Nov 12, 2026
34 checks passed
@datlechin
datlechin deleted the fix/audit-w6-windows-core branch November 12, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant