Skip to content

Conversation

@jamesgibbons92
Copy link
Collaborator

@jamesgibbons92 jamesgibbons92 commented Jan 25, 2026

Fixes #6235

getCompletedEvents trusts the outputs in state to be the expected type / shape.
If resource outputs in state contain unexpected fields or types (due to other bugs, or user error), then the cli crashes unexpectedly leading to confusing errors.
These errors are also difficult to recover from without manually altering the state file directly.
This PR just adds purely defenesive code / type assertions to ensure the data is the correct type before acting upon it.
There is no change to functionality or logic.

@jamesgibbons92 jamesgibbons92 changed the title Handle failed type assertions gracefully Bugfix: Handle failed type assertions gracefully in completed.go Jan 25, 2026
@jamesgibbons92
Copy link
Collaborator Author

jamesgibbons92 commented Jan 25, 2026

Reproduce the existing bug:

    new sst.Linkable("Linkable", {
      include: ["garbage"], // string is not a valid type in here
    });

Before fix (cli crashes with panic):

image

After fix (no crash, cli continues to function):

image

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.

Irrecoverable panic caused by empty Linkable include

2 participants