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

feat: Apps-Engine method for reading and counting unread room messages for a user #32194

Merged
merged 28 commits into from
Oct 15, 2024

Conversation

Dnouv
Copy link
Member

@Dnouv Dnouv commented Apr 12, 2024

Proposed changes (including videos or screenshots)

  • Method to fetch room unread messages based on userId and roomId
  • Method to fetch the count of unread messages based on userId and roomId

Issue(s)

Steps to test or reproduce

const userId = "W9Ms3XifoMwWemv4Q"
const roomId = "GENERAL"
const unreadMsg = await read
            .getMessageReader()
            .getUnreadByRoomAndUser(roomId, userId);

// call with custom limit and sort order
        const limitedunreadMsg = await read
           .getRoomReader()
            .getUnreadByUser(
               roomId,
                userId,
                { sort: { createdAt: "asc" }, limit: 10 }
            )


// Get total unread messages count
const totalUnread = await read
                .getUserReader()
                .getUserUnreadMessageCount(
                    roomId,
                    userId
                );

Further comments

Copy link
Contributor

dionisio-bot bot commented Apr 12, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Apr 12, 2024

🦋 Changeset detected

Latest commit: 027b566

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/network-broker Patch
@rocket.chat/models Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Apr 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.41%. Comparing base (08d0df2) to head (027b566).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #32194   +/-   ##
========================================
  Coverage    58.41%   58.41%           
========================================
  Files         2744     2744           
  Lines        66254    66254           
  Branches     14990    14990           
========================================
  Hits         38704    38704           
  Misses       24731    24731           
  Partials      2819     2819           
Flag Coverage Δ
unit 74.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@Dnouv Dnouv added this to the 6.8 milestone Apr 15, 2024
@Dnouv Dnouv changed the title feat: Apps Engine Bridge Method for Unread Room Messages feat: Apps Engine Method for Reading and Counting Unread Room Messages for a User Apr 17, 2024
@d-gubert d-gubert changed the title feat: Apps Engine Method for Reading and Counting Unread Room Messages for a User feat: Apps-Engine Method for Reading and Counting Unread Room Messages for a User Apr 17, 2024
@d-gubert d-gubert changed the title feat: Apps-Engine Method for Reading and Counting Unread Room Messages for a User feat: Apps-Engine method for reading and counting unread room messages for a user Apr 17, 2024
@Dnouv Dnouv removed this from the 6.8 milestone Apr 21, 2024
@Dnouv
Copy link
Member Author

Dnouv commented Apr 21, 2024

Removing milestone 6.8 since I can see this getting blocked by #32176 (both PRs have the same approach)

Thank you!

Copy link
Contributor

github-actions bot commented Sep 20, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-32194/
on branch gh-pages at 2024-10-15 04:10 UTC

@Dnouv Dnouv marked this pull request as ready for review October 9, 2024 11:13
@Dnouv Dnouv requested a review from a team as a code owner October 9, 2024 11:13
@Dnouv Dnouv requested a review from d-gubert October 9, 2024 11:13
.changeset/chilled-files-relate.md Outdated Show resolved Hide resolved
apps/meteor/app/apps/server/bridges/rooms.ts Outdated Show resolved Hide resolved
@Dnouv Dnouv requested a review from KevLehman October 11, 2024 13:13
@Dnouv Dnouv requested a review from KevLehman October 11, 2024 14:10
@Dnouv Dnouv removed the stat: QA assured Means it has been tested and approved by a company insider label Oct 11, 2024
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Oct 11, 2024
@Dnouv Dnouv added the stat: QA assured Means it has been tested and approved by a company insider label Oct 11, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 11, 2024
@kodiakhq kodiakhq bot merged commit dd923a8 into develop Oct 15, 2024
50 checks passed
@kodiakhq kodiakhq bot deleted the new/unread_bridge branch October 15, 2024 09:58
gabriellsh added a commit that referenced this pull request Oct 15, 2024
…ctor/avatar

* 'develop' of github.com:RocketChat/Rocket.Chat: (58 commits)
  refactor: unified users page header content into a single component (#33498)
  chore: store contact emails and phones on the same format as user's and visitor's (#33484)
  fix: broken jump-to-thread-message functionality using link  (#33332)
  feat: Apps-Engine method for reading and counting unread room messages for a user (#32194)
  feat: adds a new featured room action on the header for non-default category (#33562)
  chore(deps): bump actions/setup-node from 4.0.3 to 4.0.4 (#33327)
  fix: consider query strings in Twilio request validation (#33364)
  ci: add restore cache for `deploy-preview` (#33579)
  feat: add history endpoint (#33349)
  ci: cache artifacts to reduce api calls (#33567)
  feat: new E2EE composer hint (#33283)
  chore: Add `force` option to `rmSync` call (#33570)
  chore: remove nameInsensitive sorting on /v1/users.listByStatus (#33401)
  chore: Use `rmSync` instead of `rmdirSync` (#33551)
  feat: add contact channels (#33308)
  chore: split ImportDataConverter into multiple classes and add unit testing (#33394)
  test: added MockedDeviceContext to voip unit tests (#33553)
  refactor: adjusted voip endpoints error messages (#33515)
  fix: Cannot send messages after E2EE keys are refreshed (#33527)
  fix: Custom sounds not working when storage is set to filesystem (#33424)
  ...
@ggazzo ggazzo modified the milestones: 6.14, 7.0 Oct 17, 2024
This was referenced Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants