Skip to content

[3/4] Recover preferences on login and CLS reconnection - #454

Draft
Sheng Chen (jdneo) wants to merge 1 commit into
jdneo-preferences-02-safe-background-savesfrom
jdneo-preferences-03-lifecycle-recovery
Draft

Sheng Chen (jdneo) wants to merge 1 commit into
jdneo-preferences-02-safe-background-savesfrom
jdneo-preferences-03-lifecycle-recovery

Conversation

@jdneo

Copy link
Copy Markdown
Member

Stack

Layer 3 of 4 for nonblocking Eclipse chat preferences (#408). Depends on #453; base is jdneo-preferences-02-safe-background-saves at 139798b0db72bb8fc9b3fe3aa356dfb03545eb02. Bottom layer: #452. Implements only ticket 03 of the approved local specification; bounded shutdown saving remains for layer 4.

Changes

  • Emit a lifecycle notification from the actual pinned LSP4E StreamConnectionProvider.handleMessage hook after the outgoing initialized notification. LSP4E reaches this only after successful initialization and creates a fresh provider on restart. Deduplicate per provider and identify each connection incarnation; do not infer reconnection from authentication notifications or poll.
  • Let lifecycle-owned preference storage retry failed/unavailable initialization on login/account transitions and connection initialization, using its existing coalesced asynchronous loader, 15-second deadline, and manual retry. Pending loads join; same-account READY/dirty choices and failed save status remain intact.
  • Notify account changes even when the authentication status remains OK, with stable account snapshots for queued listeners. Invalidate mode discovery immediately on actual authentication transitions so rapid sign-out/sign-in cannot publish old callbacks. Retry failed mode discovery on recovery without reloading ready preferences.
  • Unregister authentication/connection listeners on disposal; retain layer 2's captured save destinations, serialized writer, and accepted-save draining. No protocol, preference format/path, policy, file-protection, or shutdown changes.

Verification

TDD red/green regressions cover login, actual initialized-message-to-controls recovery with SWT responsiveness, failed mode discovery, duplicate notifications, manual/recovery races, stale timed-out responses, account switching during saves, signed-out/disposed signals, and rapid same-account sign-out/sign-in with real AuthStatusManager.

All commands used command-local JAVA_HOME=C:\Users\sheche\.jdks\ms-21.0.11 and -B -Dtycho.disableP2Mirrors=true:

  • Focused reactor verify: preference/storage/model/chat-base/referenced-file tests and authentication/stream-provider tests passed.
  • mvnw.cmd clean verify: passed; 10,810 tests, 0 failures, 0 errors, 8 skips.
  • mvnw.cmd checkstyle:check: passed.
  • mvnw.cmd test: passed (Tycho executes the actual test suites during verify).

Eight POSIX-specific tests are skipped on Windows; no Linux execution claim. SWTBot probe suite remains skipped by default; the new SWT lifecycle/control tests execute in the Eclipse JUnit test bundle.

Parallel Standards/Spec reviews against the exact layer 2 baseline found no blocking issues and no missing ticket requirements. Standards noted only an existing documentation/API inconsistency: docs prescribe a nonexistent logError helper; this change follows the actual repository LOGGER convention.

Retry unsuccessful preference and mode initialization on real lifecycle transitions while preserving ready choices and account-bound saves.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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