buerokratt / Buerokratt-Chatbot

1 stars 17 forks source link

Fixes and enhancements in the header part #721

Open jaX10bt opened 3 months ago

jaX10bt commented 3 months ago

AS A Bürokratt User I WANT to only receive sound and popup notifications when a new message is received SO THAT I would know when a new message is received

currently whenever a user switches modules, a popup and ding is played for each unanswered chat. a ding and popup is also played seemingly in 2 minute intervals.

I WANT the backoffice user status to not change randomly SO THAT I can reliably keep my status as ACTIVE

currently it seems that there are 2 separate parameters that control the active status. one of them is a boolean 'active' and the other one is a string 'status'.

Acceptance Criteria

1AhmedYasser commented 3 months ago

Related to https://github.com/buerokratt/Buerokratt-Chatbot/issues/682

jaX10bt commented 3 months ago

[BUG]

Upon first logging in to the backoffice, both 'active' and 'status' are set to 'false' and 'offline' respectively. When the user then presses 'Kohal/Eemal', the POST request changes the users status in the back end but this information is not updated in the front end until another GET request is sent by for example navigating to another module.

https://github.com/buerokratt/Buerokratt-Chatbot/assets/132996313/5cb2b655-2747-4ed0-b439-846dee4bc7c3

jaX10bt commented 3 months ago

[BUG]

When a backoffice user has been idle for some time, the popup to change the status to 'kohal' appears. When 'Jah' is clicked then the status changes to 'kohal' and when 'tühista' is clicked the status remains 'eemal'. However now when the backoffice user wants to set their status to 'eemal', the popup is displayed.

Screencast from 25.06.2024 13:30:28.webm

jaX10bt commented 2 months ago

The new message notification 'ding' sound is only played in the backoffice when the backoffice tab is active. When the backoffice tab is not active (even when it is visible), there is no indication of a forwarded chat.

Image

jaX10bt commented 2 months ago

[BUG]

In training module, the popup modal that is supposed to ask 'Kas soovid muuta staatuseks "kohal"?' displays 'global.statusChangeQuestion'

Image

Fossur commented 1 month ago

https://github.com/buerokratt/sample-implementation-cvi/pull/32 https://github.com/buerokratt/Buerokratt-Chatbot/pull/825

turnerrainer commented 1 month ago

Header package needs to be deployed to NPM first.

joonasroosalung commented 1 month ago

v0.1.11 published on 8th of august https://www.npmjs.com/package/@buerokratt-ria/header/v/0.1.11

jaX10bt commented 1 month ago

Popup notifications and sound notifications are not working properly.

Active chats request is only sent when the tab is active. When the backoffice window is not active or minimized, there is no indication of a new chat.

image

SanderSepp commented 1 month ago

When admin sent message and user reads it, message with message-read event was inserted to messages table and this event message was interpreted as user message. Fix is here

https://github.com/buerokratt/Buerokratt-Chatbot/pull/844

SanderSepp commented 1 month ago

https://github.com/buerokratt/Buerokratt-Chatbot/pull/848 https://github.com/buerokratt/sample-implementation-cvi/pull/37

jaX10bt commented 1 month ago

Sound and pop-up notifications not working

SanderSepp commented 1 month ago

New chat notifications are working. One behavior could to be improved. Currently notifications are sent for each new customer message in any of the active chats (unanswered, active), IF there are any unanswered chats. Depending on business needs, the logic could be improved - whether to remove the unanswered chat length check to send notifications for all new messages regardless of the number of unanswered chats. OR if notification should be sent only about new chats (unanswered). Then we should not check for new messages in chats, instead we check only if there are any new chats.

Forwarded chat logic seems to be broken. Quick code assessment revealed that the business logic for sending notifications is there, but store state is in bad shape. Header and modules have separate stores. Header fetches and stores chats, messages etc, module is using header store for messages but stores user data in its own store. Therefore all the business checks related to user in header store are broken, because it does not contain user data. (Eg. idCode is used to find chat assignee (CSA))

If forwarded chat logic is fixed, one could also add browser notification sending there, similar to new chat logic.

turnerrainer commented 6 days ago

Will create a new issue based on what's left undone regarding this task.