Skip to content

Conversation

@tomjakubowski
Copy link
Contributor

@tomjakubowski tomjakubowski commented Aug 28, 2025

A recent change to the workspace/viewer error handling resulted in the workspace
removeTable() method always failing. This fixes the bug and adds a smoke/regression
test.

Also includes a Typescript fix for types in the custom elements registry.

Signed-off-by: Tom Jakubowski <tom@prospective.dev>
}

delete(name: K) {
const result = this._delete_listener?.(name);
Copy link
Contributor Author

@tomjakubowski tomjakubowski Aug 28, 2025

Choose a reason for hiding this comment

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

The delete listener registered by the workspace always returns undefined now, so this ended up always taking the else branch below, which skips removing the key from the map. It looks like the delete listener is not meant anymore to prevent deletes, and the workspace is the only user of this module, so I removed the conditional entirely.

The ObservableMap's delete listener used to be able to "reject"
deletions by returning false.  This is no longer the case; the listener
in Workspace always returns undefined now.  Account for this in
observable map's delete method.

Co-authored-by: Davis Silverman <davis@prospective.dev>

Signed-off-by: Tom Jakubowski <tom@prospective.dev>
@tomjakubowski tomjakubowski force-pushed the bugfix/workspace-remove-table branch from afe0dfd to 8a5b6bb Compare August 28, 2025 20:19
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good!

@texodus texodus merged commit cac88bd into perspective-dev:master Sep 1, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants