[Refactor] Remove obsolete cloud account lifecycle listeners - #1353
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Removed the obsolete auth-state and user-info extension listeners and their cleanup/test scaffolding. The live organization-settings listener remains as contained fire-and-forget work with failure logging; model-cache startup remains non-blocking. The stale Full lint, type-check, and test suites pass. Pushed in commit |
Review processThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.
Current step: The required review sequence passed. Remaining merge requirements apply. |
c86ffac to
7b04018
Compare
|
@CodeRabbit review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
🧰 Additional context used📓 Path-based instructions (7)Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases. Check cleanup and deterministic async behavior and prefer shared typed test helpe...⚙️ CodeRabbit configuration file Files:
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths. Verify promises and errors are handled, existing helpers are reused, and new code introduces no `any`, unjustified dou...⚙️ CodeRabbit configuration file Files:
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure. Check listeners, resources, and providers are disposed without stale state or duplicate w...⚙️ CodeRabbit configuration file Files:
Act as an adversarial second-opinion reviewer. Verify PR claims against implementation, contracts, and tests. Trace changed inputs through normal, boundary, error, cancellation, retry, and default paths and their consumers. Seek plausible c...⚙️ CodeRabbit configuration file Files:
Add focused tests for UI binding and save behavior, persistence or normalization, and the value returned by `getStateToPostToWebview()`, including true and false/unset cases when defaults could hide omissions.📄 CodeRabbit inference engine (AGENTS.md) Files:
Fix lint violations in new TypeScript code instead of suppressing them.📄 CodeRabbit inference engine (AGENTS.md) Files:
After editing a file, run ESLint with pruning and zero warnings for that relative file, and confirm its suppression count did not increase.📄 CodeRabbit inference engine (AGENTS.md) Files:
🔇 Additional comments (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe extension now refreshes webview state after cloud settings updates and logs asynchronous failures. Model cache refresh initialization also logs background failures without blocking activation. Tests cover both failure paths, and ESLint now checks floating promises in ChangesExtension event and async handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This refactor removes obsolete account lifecycle hooks while retaining organization-policy refreshes and non-blocking model-cache startup; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CloudService
participant Extension
participant Webview
participant OutputChannel
CloudService->>Extension: Emit settings-updated
Extension->>Webview: Refresh visible state
Webview-->>Extension: Return refresh result
Extension->>OutputChannel: Log refresh failure when rejected
🚥 Pre-merge checks | ✅ 5 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (5 passed)
Full details: Description checkExplanation The description explains the implementation, rationale, and impact, but it omits the required linked GitHub issue, test procedure, pre-submission checklist, documentation updates, and reviewer contact sections. Full details: Regression EvidenceExplanation The PR removes the Resolution Add focused extension tests that capture the third argument to Full details: Trust And Persistence InvariantsExplanation No changed path meets the failure conditions. The PR removes two CloudService webview listeners and retains the settings listener with an explicit rejection handler. CloudService still owns authentication, settings-cache persistence, and disposal; its internal auth listeners clear cached settings on logout, and extension activation registers the service for disposal. The changed model-cache call is fire-and-forget with failure logging, while model-cache writes remain atomic and unchanged. The state refresh only reads state and posts to the webview; it does not persist data. No new secret/PII flow, unvalidated execution, approval bypass, missing persistence await, or lifecycle leak is introduced.
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
src/__tests__/extension.spec.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/eslint.config.mjsESLint skipped: the matched ESLint configuration already failed (missing-dependency). src/extension.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What changed
@typescript-eslint/no-floating-promisesratchet toextension.ts.auth-state-changedanduser-infolistener registration, state refresh, and cleanup left behind after interactive cloud accounts were removed.settings-updatedfor live organization-policy refreshes as contained fire-and-forget work with failure logging.no-explicit-anysuppression, and updated focused tests.Why this change was made
The interactive cloud-account UI was already removed, and initial compatibility/static-token state is read after CloudService initialization. The auth and user-info listeners no longer provided required behavior, while the organization-settings listener remains live for policy changes.
Impact
Extension activation has fewer obsolete account lifecycle hooks. Organization policy changes still refresh visible state, model-cache startup still does not block activation, and future floating promises in
extension.tsfail lint.