Skip to content

Fix persistence provider bugs affecting new user logins - #475

Merged
jvigliotta merged 2 commits into
release/6.0.2from
fix-205-new-user-logins
Oct 19, 2026
Merged

jvigliotta merged 2 commits into
release/6.0.2from
fix-205-new-user-logins

Conversation

@mudinthewater

Copy link
Copy Markdown
Collaborator
  • createIfMissing() called this.create(model) to persist a newly created namespace's folder object, which only exists on MCWSPersistenceProvider. MCWSUserContainerProvider inherits createIfMissing() but never implemented create(), so a brand-new user's namespace was created in MCWS but its folder object was never persisted, throwing "this.create is not a function". Persist directly through the already-in-scope namespace handle instead.

  • persistenceNamespaceKeys was derived only from non-user namespace configs, so a user's leaf folder (e.g. s6a_users-clgarcia) was only claimed by MCWSPersistenceProvider.appliesTo() when a differently- configured shared namespace happened to share the same key prefix. Derive it from all namespace configs instead; the user container node stays excluded via the existing invalidNamespaceKeys exact- match check.

  • MCWSPersistenceProvider caches its namespace list for the lifetime of the provider instance. When a second user's namespace is created in a different session after the first session's cache was already populated, the first session never finds it and throws a plain TypeError, surfacing as an "Error: " placeholder object in the tree until the page is reloaded. Refresh the cache once on a lookup miss before giving up.

Fixes #205

@mudinthewater

Copy link
Copy Markdown
Collaborator Author

Also fixes #446

@jvigliotta
jvigliotta changed the base branch from release/6.0.0 to main September 28, 2026 22:49
@jvigliotta
jvigliotta force-pushed the fix-205-new-user-logins branch from 7d38937 to b1603d1 Compare September 28, 2026 22:51
@jvigliotta
jvigliotta changed the base branch from main to release/6.0.2 October 7, 2026 22:14
- createIfMissing() called this.create(model) to persist a newly
  created namespace's folder object, which only exists on
  MCWSPersistenceProvider. MCWSUserContainerProvider inherits
  createIfMissing() but never implemented create(), so a brand-new
  user's namespace was created in MCWS but its folder object was
  never persisted, throwing "this.create is not a function". Persist
  directly through the already-in-scope namespace handle instead.

- persistenceNamespaceKeys was derived only from non-user namespace
  configs, so a user's leaf folder (e.g. s6a_users-clgarcia) was only
  claimed by MCWSPersistenceProvider.appliesTo() when a differently-
  configured shared namespace happened to share the same key prefix.
  Derive it from all namespace configs instead; the user container
  node stays excluded via the existing invalidNamespaceKeys exact-
  match check.

- MCWSPersistenceProvider caches its namespace list for the lifetime
  of the provider instance. When a second user's namespace is created
  in a different session after the first session's cache was already
  populated, the first session never finds it and throws a plain
  TypeError, surfacing as an "Error: <keystring>" placeholder object
  in the tree until the page is reloaded. Refresh the cache once on a
  lookup miss before giving up.
@jvigliotta
jvigliotta force-pushed the fix-205-new-user-logins branch from b1603d1 to 93b1c77 Compare October 7, 2026 22:19
return namespace.key === persistenceSpace;
});

if (!persistenceNamespace) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

always better to check for existence and not a truthy statement

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Is that supposed to be the plan? cause we have ! everywhere in here lol

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is ok, we definitely do this elsewhere, even though it's not the best way to go about it. But, I will update it to be if (persistenceNamespace === undefined) to be more clear. We only act if it's undefined.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes we do this elsewhere but we probably shouldn't in most cases

@davetsay

Copy link
Copy Markdown
Collaborator

@jvigliotta , @mudinthewater , i added a couple of comments but this looks good otherwise. good job

@jvigliotta
jvigliotta requested a review from davetsay October 19, 2026 19:03
@sonarqubecloud

Copy link
Copy Markdown

@jvigliotta
jvigliotta merged commit c34cbf9 into release/6.0.2 Oct 19, 2026
4 checks passed
@jvigliotta
jvigliotta deleted the fix-205-new-user-logins branch October 19, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New user logins break the any current user's folder

3 participants