Skip to content

Conversation

@kddejong
Copy link
Contributor

@kddejong kddejong commented Dec 16, 2025

Problem

  1. Duplicate error notifications: Users see the same error twice - once from the LSP client error handler and again from
    the calling code
  2. Infinite retry loop: When loadStacks() fails, the loaded flag stays false, causing the UI to continuously retry loading
    stacks
  3. Unclear error context: Generic error messages don't indicate which operation failed

Solution

Error handling:

  • LSP client now logs errors instead of showing popups - callers handle user-facing messages
  • Removed redundant error handling in refreshResourceListCommand (ResourcesManager already handles it)
  • Made error messages more specific (e.g., "Loading AWS::Lambda::Function resources")

Infinite loop fix:

  • Moved loaded=true to finally block in StacksManager.loadStacks() so it's set even on failure
  • Applied same pattern to ResourcesManager - moved notifyAllListeners() to finally block

Tests:

  • Added coverage for refreshResourceListCommand error scenarios
  • Added test verifying ResourcesManager error handling

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kddejong kddejong requested a review from a team as a code owner December 16, 2025 19:18
@kddejong kddejong force-pushed the fix/cloudformation/listStacks/infiniteloop branch from 322ac32 to b4d3aa3 Compare December 16, 2025 19:19
@kddejong kddejong changed the title Simplified error message handling from server to client fix(cloudformation): Simplified error message handling from server to client Dec 16, 2025
@kddejong kddejong closed this Dec 16, 2025
@kddejong kddejong reopened this Dec 16, 2025
@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@kddejong kddejong force-pushed the fix/cloudformation/listStacks/infiniteloop branch 9 times, most recently from 2e2cad5 to 6920226 Compare December 17, 2025 17:19
@kddejong kddejong force-pushed the fix/cloudformation/listStacks/infiniteloop branch from 6920226 to b9671c6 Compare December 17, 2025 18:24
}

try {
await resourcesManager.refreshResourceList(resourceTypeNode.typeName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably get rid of the try/catch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unresolved. I added it back because we are expecting the error to be silently moved on from. We are already displaying the error in logs and notifications at another level so for here we just want to silently continue.

@kddejong kddejong force-pushed the fix/cloudformation/listStacks/infiniteloop branch from a281775 to b9671c6 Compare December 17, 2025 20:35
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.

3 participants