Allow overlapping StateDB namespaces #7257
Labels
status:resolved-locked
Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone
Description
In StateDB, when filtering state based on the namespace, it only checks that the stored value starts with the namespace, not that the namespace matches exactly:
jupyterlab/packages/coreutils/src/statedb.ts
Line 298 in d427440
Reproduce
When using two widget trackers with namespaces
myplugin
andmyplugin-secondary
, all widgets frommyplugin-secondary
will try to be restored formyplugin
, since they share a prefix.Expected behavior
The state for things with different namespaces are segregated.
Proposed solution
Since ids are specified as
'namespace:identifier'
,StateDB.Connector.list()
should split all keys on:
, and check for strict equality to the namespace.The text was updated successfully, but these errors were encountered: