-
-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Correct recursion error on load in JupyterHub #178
Conversation
@JasonWeill @dlqqq This is my first PR in this project. Not sure if I need permissions to add reviewers and labels. |
@mschroering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mschroering! Thank you for opening this PR! 🎉
I'm not sure if the recursion error is coming from our end; current_user
is not a property we define, so self.current_user
shouldn't invoke ChatHandler#get_current_user()
. Otherwise, this would cause an error in all environments, not just JupyterHub. This seems to be an issue with JupyterHub's identity provider. Could you post the full stack trace here for us to investigate this a bit further?
My concern is that if calling self.current_user
is causing JupyterHub to throw the RecursionError, then Jupyter AI won't work when collaborative mode is enabled. Look at the lines above:
if collaborative:
return ChatUser(**asdict(self.current_user))
In the single-user scenario, using the shell login name for the username (which is more like a unique user ID) is perfectly fine, since any ID will work in the single-user case. My concern is that we may not be fixing the root issue.
Yeah, I included the full stack trace on the issue I reported: #168 And yeah, I think the same recursion error will happen with collaborative mode enabled. I did not test that. |
@mschroering Ah, inheritance is really the gift that keeps on giving 😁. Thank you for digging that up. Seems like the real solution is to rename the method to something like |
@dlqqq yes, I will work on getting those changes. |
@dlqqq I have made the updates. |
* fix: Correct recursion error on load in JupyterHub * fix: Renamed get_current_user to get_chat_user
* fix: Correct recursion error on load in JupyterHub * fix: Renamed get_current_user to get_chat_user
Fixes #168
RequestHandler.current_user
callsRequestHandler.get_current_user()
when not set initially. This causes a recursive loop on load when running the extension in JupyterHub. Changed to use thelogin
value which is being used for the other User fields.