Services Plugins FAQs

DuoChat - Counter increment problem

Hello,
The counter at the top works well when the message tabs are closed and user clicks to see the message.

Now, when users are chatting ( and both windows / browsers) are open the counter keeps incrementing. The "unread = no " is not being triggered when users keep the message window opened.

how can we fix this problem?

Thank you

Caio

Hi Caio, weā€™ll check it out and get back to you asap

1 Like

Hello, Caio.

I checked the template, Iā€™m not sure I follow the ā€œunread = noā€ field what is not triggered, when is the action ? When creating new message while it is Sent?
Could please post more details, images of your workflow setup or video so we could try replicate.

Thanks for understanding.

[Iā€™m not using the template. Iā€™m using the code explained on the course DuoChat]

Scenario: Open two browsers, two different users and start chatting (leave the chat window opened).

You will see that the ā€˜new messageā€™ counter at the top keeps incrementing.

The unread=no only triggers when you click on the conversation tab (not when the window is already opened)

Hello @caioprezia

Could please provide a video of what youā€™re trying to achieve and the workflow of condition which is not triggered?
Thanks for understanding

Regards,
ZQ Team.

28%20PM

Hi Caio!
Can you please provide us a screenshot or video of workflow youā€™re using so we can have a full picture and help you?
Thanks a lot!

Hello Yulia, Thanks for your message.

This is actually a bug from the code provided on the DuoChat

Waiting for the fix from @levon or @Dumitru

Sorry to keep you waiting for so long. Thank you for being so patient and sharing your feedback with us.

Looks like the condition that is currently set in the DuoChat course does not cover the scenario you were trying to implement in your app.

In the course we cover the scenario implying that unread messages counter resets once you click on the current userā€™s tab.

To make it work while both participants of the conversation have their tabs open, we recommend to set another condition to the recipient.

You have to set condition unread=no to the current userā€™s conversation when the recipient creates a new message.
This condition may be applied to the ā€œSendā€ button.

Thus when creating/sending a new message, the notifications counter will reset.

Sorry for any inconvenience caused, we hope to have you back at Zeroqode Lab.

Thanks for your reply Yulia :blush:

This is not a scenario that ā€œIā€ want to implement on the app. This is a scenario that might happen with anyone using DuoChat - thatā€™s is real life scenario. (the name DuoChat already imply that this situation might happen)

The chat tab might be opened or not. We canā€™t predict how users will use.

Because of that the solution above does not work because you are assuming the tab will be open all the time.

Thank you
Caio

Sorry for confusing you, Caio.

Thank you for your feedback, we appreciate your time and effort spent on explaining us the problem.
You are right again - we did not cover this scenario in our course, and itā€™s a super-common one, not sure how we missed it :slightly_smiling_face:

As an interim fix of the problem, we recommend adding the following logic to the conversation screen -

  • Add the workflows step to do a search for all the unread messages in the current conversation and change it to ā€œReadā€ whenever the user is hitting the ā€œSendā€ button.

We are now validating and will update this thread and the course with the enhanced logic that would do this smarter as soon as we confirm this as working.

Best regards
Yulia

Thank you very much Yulia.

Hey can anyone help me how can I see a message notification whenever a new message arrive?

and I need to change the format how a notification in the header box is received, I just want the First name of person to be seen not the full name. I am using Linky template.
For Eg in the notification I see- (John Santos viewed your profile)
What I want - John viewed your profile.