Include child thread messages in main message feed on mobile
Part of https://gitlab.com/gitlab-org/gitter/gitter-ios-app/issues/55
This MR introduces includeThreads
option for chatService
. This option allows clients of this service to specify they would like to include child messages in the search results.
3 ways to search for messages
graph LR
A[chat-internal] -- chat-snaphost-options --> N[chatService]
B[authorisor] -- populateSubTroupeCollection --> N
C[api/chatMessages] -- serializeChatsForTroupe --> N
-
chat-internal
is used for rendering html page of the room -
authorisor
populate
- is used to send a snapshot of the chat after subscribing tobayeux
channel - API access to chat messages is used for infinite scrolling
DEV notes
- there is a
body.mobile-embedded
CSS. It's rendered to a template at the time when we generate assets for native mobile apps. then it is used byis-mobile-embedded.js
which can be called anywhere on the frontend. - we can translate the presence of
mobile-embedded
class into aincludeThreads
property. There are 3 places where thechatService.findChatMessagesForTroupe()
the method gets called from.-
chat-internal
serializing chats to a troupe- here we can easily leverage the
req.isPhone
property
- here we can easily leverage the
-
authorisor
for bayeux, sending snapshot of messages after the user subscribes to achatMessages
channel - API requests - used for infinite scrolling
-
Testing strategy
- have a room with 50+ messages in total, mixed thread and normal messages, with the room based feature toggle enabled
- Desktop and mobile web
- initial page load shouldn't contain any child messages
- Scroll up to trigger infinite scrolling, no child messages should be fetched, you can inspect the API request containing
includeThreads=false
-
⚠ (is still need to fix this one) send a threaded message from another user, verify that it doesn't show in the MMF. (unchanged behaviour - all threaded messages that are newly sent are in the markup, but we are hiding them using thethreaded-conversation-chat-item
CSS class)
- iOS app - you can compile assets by running
NODE_ENV=dev npm run build-ios-assets
and connect it to localwebapp
(https://gitlab.com/gitlab-org/gitter/gitter-ios-app/merge_requests/17)- validate that the arrow icon for
-> 5 replies
parent message indicator is present - all child messages are shown in the MMF, each one of them has an indicator that can be clicked and it opens a normal browser with the thread
- validate that the arrow icon for
Edited by Tomas Vik (OOO back on 2024-09-23)