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

Adds subscription for contacts on chat page #150

Merged
merged 5 commits into from
Aug 8, 2023
Merged

Conversation

VishalZ123
Copy link
Collaborator

@VishalZ123 VishalZ123 commented Jul 31, 2023

Adds subscriptions for contacts message on chat page

Summary

This adds the feature of updating the contact card on the chat screen when a user sends or receives messages.

Changes made

  • Adds contact field in MESSAGE_RECEIVED_SUBSCRIPTION & MESSAGE_RECEIVED_SUBSCRIPTION subscriptions.
  • Adds function to update the cache when a message is sent or received.

Issues

Closes: #139

@mdshamoon Please review this PR.

@VishalZ123 VishalZ123 requested a review from mdshamoon July 31, 2023 17:00
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch coverage: 51.02% and project coverage change: -0.58% ⚠️

Comparison is base (7f8a50a) 68.65% compared to head (d557b07) 68.08%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
- Coverage   68.65%   68.08%   -0.58%     
==========================================
  Files          77       77              
  Lines        1171     1178       +7     
  Branches       97      101       +4     
==========================================
- Hits          804      802       -2     
- Misses        340      348       +8     
- Partials       27       28       +1     
Files Changed Coverage Δ
components/headers/ChatHeader.tsx 83.63% <ø> (-0.30%) ⬇️
components/messages/MessageList.tsx 35.48% <ø> (+6.73%) ⬆️
components/ui/SearchBar.tsx 84.00% <ø> (-0.32%) ⬇️
graphql/subscriptions/Chat.ts 100.00% <ø> (ø)
screens/SavedSearches.tsx 85.71% <ø> (-14.29%) ⬇️
screens/Chat.tsx 55.88% <31.42%> (-28.74%) ⬇️
components/CollectionCard.tsx 100.00% <100.00%> (ø)
components/ContactCard.tsx 84.21% <100.00%> (-0.79%) ⬇️
components/ui/MultiSelect.tsx 100.00% <100.00%> (ø)
screens/ChatScreen.tsx 100.00% <100.00%> (ø)
... and 3 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

screens/Chat.tsx Outdated
@@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react';
/* eslint-disable prettier/prettier */
Copy link
Member

Choose a reason for hiding this comment

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

Why are we disabling this?

Copy link
Collaborator Author

@VishalZ123 VishalZ123 Aug 3, 2023

Choose a reason for hiding this comment

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

It was added by mistake, I removed it in the latest changes

screens/Chat.tsx Outdated
Comment on lines 28 to 32
switch (action) {
case 'RECEIVED':
contactId = subscriptionData.data.receivedMessage.contact.id;
id = subscriptionData.data.receivedMessage.id;
body = subscriptionData.data.receivedMessage.body;
Copy link
Member

Choose a reason for hiding this comment

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

I think this is similar to what we have done in message list. Can you create a common functiona and use in both places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Implemented

@ajaman190
Copy link
Collaborator

@VishalZ123 can you please fix all deep scan problems first.

@ajaman190 ajaman190 requested a review from mdshamoon August 7, 2023 05:41
@mdshamoon mdshamoon merged commit 0ffd424 into main Aug 8, 2023
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.

Subscriptions for a new message on the main chat page
3 participants