Skip to content

Blake1/bac 45 comment thread reply notification service support#722

Merged
synoet merged 43 commits intomainfrom
blake1/bac-45-comment-thread-reply-notification-service-support
Jan 14, 2026
Merged

Blake1/bac 45 comment thread reply notification service support#722
synoet merged 43 commits intomainfrom
blake1/bac-45-comment-thread-reply-notification-service-support

Conversation

@cowlicks
Copy link
Copy Markdown
Contributor

No description provided.

@linear
Copy link
Copy Markdown

linear bot commented Dec 18, 2025

@cowlicks cowlicks force-pushed the blake1/bac-45-comment-thread-reply-notification-service-support branch from bd4c5c5 to 1653d34 Compare December 30, 2025 17:26
@cowlicks cowlicks marked this pull request as ready for review January 5, 2026 20:56
@cowlicks cowlicks requested review from a team as code owners January 5, 2026 20:56
@cowlicks cowlicks force-pushed the blake1/bac-45-comment-thread-reply-notification-service-support branch 2 times, most recently from b15ba0b to 359e7a4 Compare January 5, 2026 23:26
@cowlicks cowlicks force-pushed the blake1/bac-45-comment-thread-reply-notification-service-support branch from 359e7a4 to e81cee2 Compare January 6, 2026 20:12
whutchinson98
whutchinson98 previously approved these changes Jan 6, 2026
Copy link
Copy Markdown
Member

@whutchinson98 whutchinson98 left a comment

Choose a reason for hiding this comment

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

The backend side looks good to me.

@cowlicks can you get someone with more solid experience to review the js portion please

@cowlicks cowlicks requested a review from synoet January 7, 2026 21:55
@cowlicks cowlicks force-pushed the blake1/bac-45-comment-thread-reply-notification-service-support branch from 577dfe1 to a088332 Compare January 8, 2026 22:35
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 8, 2026

@cowlicks
Copy link
Copy Markdown
Contributor Author

cowlicks commented Jan 8, 2026

I think the failures are due to both FE & BE types changes. They should be sync'd though.

@cowlicks cowlicks force-pushed the blake1/bac-45-comment-thread-reply-notification-service-support branch 2 times, most recently from edc59e1 to e47a892 Compare January 13, 2026 16:52
@macro-inc macro-inc deleted a comment from claude bot Jan 13, 2026
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 13, 2026

Code review

Found one issue that needs attention:

Missing middleware for edit_comment_handler

Location: rust/cloud-storage/document_storage_service/src/api/annotations/mod.rs lines 53-56

Issue: The edit_comment_handler function requires a document_context: Extension<DocumentBasic> parameter (see edit_comment.rs:53), but the route in mod.rs does not have the ensure_document_exists middleware applied. This will cause a runtime error when the endpoint is called because the extension will not be present.

Comparison: The create_comment_handler route at mod.rs:38-45 correctly applies the middleware:

.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 edit_comment route needs either:

  1. The same middleware applied to the route, OR
  2. A different approach to obtain the DocumentBasic context (e.g., fetching it from the comment's associated document within the handler)

Note: The current route path /comments/comment/:comment_id only has comment_id, while the middleware expects a document_id path parameter. This will need to be addressed in the fix.

State(conn_gateway_client): State<Arc<ConnectionGatewayClient>>,
user_context: Extension<UserContext>,
Extension(UserContext { user_id, .. }): Extension<UserContext>,
document_context: Extension<DocumentBasic>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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_notify for events.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It looks like we're already getting the document_id & owner within the edit_document_comment so I'll the needed document data there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

awesome

@cowlicks cowlicks force-pushed the blake1/bac-45-comment-thread-reply-notification-service-support branch from 0c16158 to 797c6f2 Compare January 13, 2026 22:49
@synoet synoet merged commit 1c315c1 into main Jan 14, 2026
38 checks passed
@synoet synoet deleted the blake1/bac-45-comment-thread-reply-notification-service-support branch January 14, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants