Skip to content

Conversation

@Zsailer
Copy link
Collaborator

@Zsailer Zsailer commented May 14, 2025

No description provided.

@Zsailer Zsailer requested a review from dlqqq May 14, 2025 05:07
Comment on lines +24 to +27
@authorized
def post(self):
try:
path = self.get_argument("path")
Copy link
Collaborator

Choose a reason for hiding this comment

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

my bad, I did not follow full conversation. why is this a post request? is it because if file Id did not exist, it will be created?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah that's right.

path = self.get_argument("path")
id = self.file_id_manager.index(path)
self.write(json_encode({"id": id, "path": path}))
except web.MissingArgumentError:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are there other exceptions that file_id_manager.index can raise that we need to catch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are no other specific errors that the file_id_manager raises.

sqlite3 could, in principle, raise an exception, but I don't think we should do anything special to handle that case—just let it raise a 500 and display the error to the user?

@ellisonbg
Copy link
Collaborator

Also, can't we delete the session_manager that is in main with this PR, or do you want to wait until the frontend is mitragted to use the new endpoint in this PR?

@Zsailer
Copy link
Collaborator Author

Zsailer commented May 14, 2025

Also, can't we delete the session_manager that is in main with this PR, or do you want to wait until the frontend is mitragted to use the new endpoint in this PR?

Do you mean the document session API (not the Jupyter Server session manager)?

The Jupyter Server session manager is still needed to mapping the ydoc to kernel client. I still believe that is the correct API for bridging the two.

# handler that just adds compatibility with Jupyter Collaboration's frontend
(r"api/collaboration/session/(.*)", YRoomSessionHandler)
(r"api/collaboration/session/(.*)", YRoomSessionHandler),
(r"api/fileid/index", FileIDIndexHandler)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this API be used by UI code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep!

@Zsailer Zsailer closed this May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants