The existing code here tried to "sync" all users back to Keycloak whenever any new user logs in via JupyterHub. However, it mistakenly set every user who exists in Keycloak (who wasn't previously synced) as having the new user's home directory, which leads to problems for those users should they try to spawn notebook servers, etc.
This caught us badly in our official deployment (we're updating all user's homedirs manually in Keycloak now). Haven't been able to test this new code change directly since all users have accounts at this point, but I believe it's what was intended here.
The existing code here tried to "sync" all users back to Keycloak whenever any new user logs in via JupyterHub. However, it mistakenly set every user who exists in Keycloak (who wasn't previously synced) as having the new user's home directory, which leads to problems for those users should they try to spawn notebook servers, etc.
This caught us badly in our official deployment (we're updating all user's homedirs manually in Keycloak now). Haven't been able to test this new code change directly since all users have accounts at this point, but I believe it's what was intended here.
PTAL @costrouc @Adam-D-Lewis cc: @ericdwang