Conversation
rust/cloud-storage/document_storage_service/src/api/annotations/create_comment.rs
Outdated
Show resolved
Hide resolved
bd4c5c5 to
1653d34
Compare
b15ba0b to
359e7a4
Compare
rust/cloud-storage/document_storage_service/src/api/annotations/edit_comment.rs
Show resolved
Hide resolved
rust/cloud-storage/document_storage_service/src/api/annotations/create_comment.rs
Show resolved
Hide resolved
359e7a4 to
e81cee2
Compare
whutchinson98
left a comment
There was a problem hiding this comment.
The backend side looks good to me.
@cowlicks can you get someone with more solid experience to review the js portion please
577dfe1 to
a088332
Compare
|
I think the failures are due to both FE & BE types changes. They should be sync'd though. |
edc59e1 to
e47a892
Compare
Code reviewFound one issue that needs attention: Missing middleware for edit_comment_handlerLocation: Issue: The Comparison: The .route(
"/comments/document/:document_id",
post(create_comment::create_comment_handler).layer(ServiceBuilder::new().layer(
axum::middleware::from_fn_with_state(
state.clone(),
macro_middleware::cloud_storage::document::ensure_document_exists::handler,
),
)),
)Fix needed: The
Note: The current route path |
| State(conn_gateway_client): State<Arc<ConnectionGatewayClient>>, | ||
| user_context: Extension<UserContext>, | ||
| Extension(UserContext { user_id, .. }): Extension<UserContext>, | ||
| document_context: Extension<DocumentBasic>, |
There was a problem hiding this comment.
@cowlicks Claude caught a good bug actually. This can't get attached since there is no document_id in the request. Is this even needed?
There was a problem hiding this comment.
Hmmm yeah I'm not sure what to do about that. Ideas:
- add a new route
/document/:document_id/comment/:comment_id. breaking the current API. - adding document_id etc to body. we would still have to hit the db to verify the comment is actually on the document. And if we are doing that we might as well drop the body data and do....
- Fetch the document_id etc from the db and use it to build and send the notification. This seems like the best option. Leaving the API as is. We could later use this logic if we move to using
pg_notifyfor events.
There was a problem hiding this comment.
It looks like we're already getting the document_id & owner within the edit_document_comment so I'll the needed document data there.
0c16158 to
797c6f2
Compare
No description provided.