Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#124/auto conversation restart #204

Closed
wants to merge 29 commits into from
Closed

Conversation

eliazzo
Copy link

@eliazzo eliazzo commented May 14, 2024

Description

Closes #124

If a user deletes the conversation and their partner continues to send messages the conversation is restarted for the user and displays all previous messages.

Files changed

components/messaging/ConversationsList.tsx

  • payload is modified to mark member_has_deleted as true within the conversations object of the payload
  • handler checks if the updated conversation is part of allConversations. If found, and if member_has_deleted is marked as true in the updated payload, it updates this value in the corresponding conversation in the state

components/messaging/MessageForm.tsx

  • check if member_has_deleted is true, which means a conversation member had previously marked the conversation as deleted
  • if the conversation has been marked as deleted, the convoRestart function is called
  • After restarting the conversation, the state update for the currentConversation is performed to reset the member_has_deleted flag to false

supabase/models/messaging/convoRestart.ts

  • convoRestart function reactivates the conversation in supabase after it has been marked as deleted

UI changes

no ui changes other than those merged from dev

Copy link

netlify bot commented May 14, 2024

Deploy Preview for cool-creponne-3e1272 ready!

Name Link
🔨 Latest commit b831848
🔍 Latest deploy log https://app.netlify.com/sites/cool-creponne-3e1272/deploys/66475a8a3e649000091bf35d
😎 Deploy Preview https://deploy-preview-204--cool-creponne-3e1272.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@camelPhonso camelPhonso left a comment

Choose a reason for hiding this comment

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

I've made some comments on naming conventions and cleaning up some comments, logs, ghost code..

BUT

while testing this I ran into a weird fringe case:

  • create a conversation
  • delete it on one end before sending any messages
  • send a new message from the other side
  • you've now got that message on screen twice (for the sender only)
Screenshot 2024-05-15 at 17 27 13

This is quite edge and I think it could be a solve it with the feature live situation but maybe we should stress test the whole thing a little more before merging - maybe you should think about linking up one of the QA's to this ❓

components/messaging/MessageForm.tsx Outdated Show resolved Hide resolved
components/messaging/MessageForm.tsx Outdated Show resolved Hide resolved
supabase/models/messaging/convoRestart.ts Outdated Show resolved Hide resolved
supabase/models/messaging/convoRestart.ts Outdated Show resolved Hide resolved
supabase/models/messaging/convoRestart.ts Outdated Show resolved Hide resolved
types/messagingTypes.ts Outdated Show resolved Hide resolved
@eliazzo
Copy link
Author

eliazzo commented May 17, 2024

I've made some comments on naming conventions and cleaning up some comments, logs, ghost code..

BUT

while testing this I ran into a weird fringe case:

  • create a conversation
  • delete it on one end before sending any messages
  • send a new message from the other side
  • you've now got that message on screen twice (for the sender only)
Screenshot 2024-05-15 at 17 27 13 This is _quite_ edge and I think it could be a _solve it with the feature live_ situation but maybe we should stress test the whole thing a little more before merging - maybe you should think about linking up one of the QA's to this ❓

Thanks for this. Noting down our conversation from earlier here so we have a record:

This edge case should be solved once we correct the conversation start functionality. At the moment, when a user starts a conversation, the item owner is notified and has an empty conversation appear in their conversation list. The desired functionality is for the item owner to be notified only once the first message has been sent. This means that it will be impossible to create a conversation and send a message from the other side before a message has been sent and therefore this edge case cannot be recreated.

@eliazzo eliazzo marked this pull request as draft May 24, 2024 09:39
@eliazzo eliazzo closed this Jun 6, 2024
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.

Auto Conversation restart.
4 participants