chat-e2ee icon indicating copy to clipboard operation
chat-e2ee copied to clipboard

Related to delete link feature

Open TrishalaGhetiya opened this issue 1 year ago • 10 comments

Problem:

  1. When one person deletes the link and other doesn't know about it and tries to send message, it shows failed to send message try again. This doesn't give a clear message to the user that link is deleted. It can also convey that there might be other issue like network problem or such.
  2. If I am opening the same link from the tab that I have deleted, it says waiting for alice to join whereas other person is already joined.

Solution:

  1. When one user deletes the link, the chat from the other person should also be deleted giving a message this link is destroyed
  2. Instead of sending the message "failed to send message try again", should give some specific message like link is deleted.

image

TrishalaGhetiya avatar May 28 '24 18:05 TrishalaGhetiya

i do like to contribute to contribute to on this issue , i can learn new thing's i will start work on it if u assign this to me

chandankumarm55 avatar Sep 05 '24 20:09 chandankumarm55

Sure, go ahead!

muke1908 avatar Sep 05 '24 21:09 muke1908

Hello @muke1908 ,

I have a question regarding the use of backend URLs in the .env file. I understand that it's common practice to store the backend URL as an environment variable, like BACKEND_URL, and use it in the code.

I recently made some changes to the backend, including creating a new method in the service and defining it in sdk.ts and types.tsx. However, when I try to use this method in the frontend, I encounter an error stating that the method is not defined in the IChatE2EE class. I have run npm run build-service-sdk after making these changes, but the issue persists.

Additionally, I noticed that when sending a request to the backend URL directly, like http://localhost:3001/api/chat-link/status/4bf42961-e3cf-469a-9ae6-dea5b66d2fcf, it behaves as expected. This makes me wonder if it's more practical to continue using the backend URL directly in the client rather than modifying the service folder.

Screenshot 2024-09-09 010455

Screenshot 2024-09-09 010540 [ Screenshot 2024-09-09 004700 Screenshot 2024-09-09 011035(url)

Screenshot 2024-09-09 012055

If you want to add the isLinkValid function to the service folder, could you please guide me on how to properly export this function?

For now, my proposed solution is to add the backend URL to the .env.sample file and make requests directly to the backend. Should I proceed with this approach, or is there a better method to resolve this issue?

if you want to add the memener function isLinnkValid in the service folder please guide me how to export the function . please reply my solution is add a backend url in .env.samle file then make a request to backend as your api of valid status is not made a member function of IChatE2EE class .so i will add this url backend request and push the code shall i ?

i hope u r happy with my solution , if u have any other solution please inform me ..!!

chandankumarm55 avatar Sep 08 '24 19:09 chandankumarm55

@chandankumarm55 Did you add the new methods in declaration file as well? types https://github.com/muke1908/chat-e2ee/blob/master/service/src/public/types.ts

muke1908 avatar Sep 11 '24 21:09 muke1908

Screenshot 2024-09-12 095126

can see the comment at line number 29 and 30 .

chandankumarm55 avatar Sep 12 '24 04:09 chandankumarm55

@muke1908 if your ok then we will easly fix with using backend URL and sending the request for url at http://localhost:3001/api/chat-link/status/${channelID} we can improve this api at backend then we can easy fix this issue . if your ok i will create a PR.

chandankumarm55 avatar Sep 12 '24 04:09 chandankumarm55

@chandankumarm55 I did not understand what you mean by using "backend URL"

To resolve the other issue (method not found), you can try: 1 - update the version in package.json in ./service 2 - npm run build-service-sdk 3 - go to ./client, run npm install

muke1908 avatar Sep 12 '24 08:09 muke1908

@muke1908 When we start this application locally, the frontend runs on localhost:3000 and the backend server runs on localhost:3001. So, these are the URLs we use for running the app locally, correct?

I noticed that after deploying the app, the frontend is running at https://chat-e2ee-2.azurewebsites.net/. Additionally, when we send requests to the backend, I see in the network tab that we're hitting the backend at the same URL: https://chat-e2ee-2.azurewebsites.net.

Since both the frontend and backend are using the same URL after deployment, would it be correct to assume that if we hit the API http://chat-e2ee-2.azurewebsites.net/api/chat-link/status/${channelID} every time the user component changes, we can trigger this API call and exit?

so if we had this url (we can add .env file ) and fetch the data every time if it return false then it will move both user to / route

chandankumarm55 avatar Sep 12 '24 09:09 chandankumarm55

i have tested the production mode api also if the link is not valid then it return the below response

Screenshot 2024-09-12 152915

if the link is valid then it return as

Screenshot 2024-09-12 153014

so we need to improve the api returning status correctly at the backend that is db folder . so i have improved also locally but for production model only u need create a .env file and add the key pair as BACKEND_URL = https://chat-e2ee-2.azurewebsites.net/ . it is enough . can i create a PR now . i think u understand . and i also i need to ask to show the component in front end . should i add component for showing that any one of you deleted a link or make a alert message .

file 's to be changed are - client/src/pages/messaging/index.js and .env and backend = backend/api/chatLink/index.js

chandankumarm55 avatar Sep 12 '24 10:09 chandankumarm55

@chandankumarm55 yes, please create a PR

muke1908 avatar Sep 12 '24 11:09 muke1908