Skip to content

Conversation

@ABHISHEK0S1INGH
Copy link

No description provided.

Copilot AI review requested due to automatic review settings December 9, 2025 13:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a new image upload API endpoint for chat functionality, allowing users to upload images that will be stored in the database and associated with sender and receiver users.

Key Changes:

  • New REST endpoint /api/auth/upload-image to handle multipart file uploads
  • New ChatImageDto JPA entity to store image binary data with sender/receiver relationships
  • Custom native query in ChatImageRepo for inserting images with PostgreSQL bytea type handling

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 13 comments.

File Description
backend/src/main/java/vaultWeb/controllers/UserController.java Adds POST endpoint for image uploads with multipart file handling
backend/src/main/java/vaultWeb/services/UserService.java Implements image upload business logic and orchestrates repository calls
backend/src/main/java/vaultWeb/repositories/ChatImageRepo.java Defines repository interface with custom native SQL INSERT query for image storage
backend/src/main/java/vaultWeb/dtos/ChatImageDto.java Creates JPA entity for chat_images table with bytea column for binary data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ABHISHEK0S1INGH
Copy link
Author

@DenizAltunkapan Can you please review this PR, i fixed issues suggested by copilot.

@ABHISHEK0S1INGH
Copy link
Author

@DenizAltunkapan i fixed the issue using mvn spotless:apply and ./mvnw spotless:check locally. You can check again.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DenizAltunkapan
Copy link
Member

@ABHISHEK0S1INGH you forgot the formatting haha

@ABHISHEK0S1INGH
Copy link
Author

ABHISHEK0S1INGH commented Dec 10, 2025

@ABHISHEK0S1INGH you forgot the formatting haha

recheck formatted now @DenizAltunkapan

@DenizAltunkapan
Copy link
Member

@ABHISHEK0S1INGH when are you planning to implement the corresponding frontend code?

@ABHISHEK0S1INGH
Copy link
Author

Hi @DenizAltunkapan, I’ve started reviewing the code. Since I’m focused on backend development, it might take a little time to go through everything thoroughly.

@DenizAltunkapan
Copy link
Member

@ABHISHEK0S1INGH
Thanks for the contribution!
The implementation of the image upload endpoint is well-structured and technically clean.
However, this PR does not yet fulfill the original issue requirements.

The issue was about sending images in private chats, meaning:

  • creating a ChatMessage of type image
  • broadcasting it via WebSocket
  • extending ChatMessageDto to include image metadata
  • returning image messages in /api/private-chats/private
  • providing an endpoint to serve the image binaries

This PR currently only handles file upload but stops before integrating the uploaded image into the chat system.

Could you extend the PR to include the missing functionality so that images actually appear as chat messages?

@ABHISHEK0S1INGH
Copy link
Author

@ABHISHEK0S1INGH
Thanks for the contribution!
The implementation of the image upload endpoint is well-structured and technically clean.
However, this PR does not yet fulfill the original issue requirements.

The issue was about sending images in private chats, meaning:

  • creating a ChatMessage of type image
  • broadcasting it via WebSocket
  • extending ChatMessageDto to include image metadata
  • returning image messages in /api/private-chats/private
  • providing an endpoint to serve the image binaries

This PR currently only handles file upload but stops before integrating the uploaded image into the chat system.

Could you extend the PR to include the missing functionality so that images actually appear as chat messages?

Hi @DenizAltunkapan , Thanks for the detailed feedback!
Understood — I’ll extend the PR to include all the missing functionality and ensure that image messages are fully integrated into the private chat flow (message creation, WebSocket broadcasting, DTO updates, retrieval, and image-serving endpoint).

I’ll update the PR accordingly soon.

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.

Add Support for Sending Images in Chats

2 participants