Skip to content

Log warning when we hit the archive size limit

Recently we introduced an archive limit in

https://gitlab.com/gitlab-org/gitter/webapp/-/merge_requests/1887

This is a small code change that will log a warning every time this limit applies.

That way we will know how often we return cropped archives.

Testing strategy

  1. Find a day when you have multiple messages in your room
  2. Go to that archive page e.g. http://localhost:5000/community/redirect/archives/2020/02/06
  3. Change the ARCHIVE_MESSAGE_LIMIT constant in modules/chats/lib/chat-service.js to number smaller than the number of messages in your archive day
  4. Refresh the archive page
  5. Observe the messages being limited to your new limit.
  6. Observe warning in the log
    2020-06-03T08:59:23.751Z - warn: Archive for room 5dc2baa9d2e46b7fc133cf29 on the day (Thu Feb 06 2020 00:00:00 GMT+0000 - Fri Feb 07 2020 00:00:00 GMT+0000) has more than 10 messages
Edited by Tomas Vik (OOO back on 2024-08-12)

Merge request reports