Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
aad915d
fix: read receipts not turning blue when all active users have read
abhinavkrin Feb 24, 2026
f24d4ea
added changeset
abhinavkrin Feb 24, 2026
f6f0360
unarchive subscription of only active users
abhinavkrin Mar 2, 2026
6b40a46
minor change
abhinavkrin Mar 2, 2026
2c503f1
Merge branch 'develop' into fix/read-receipts-ignore-deactivated-users
abhinavkrin Mar 6, 2026
6d56a2b
Merge branch 'develop' into fix/read-receipts-ignore-deactivated-users
abhinavkrin Mar 7, 2026
f530108
Merge branch 'develop' into fix/read-receipts-ignore-deactivated-users
abhinavkrin Mar 9, 2026
d081e06
test fix
abhinavkrin Mar 9, 2026
3cf6407
Merge branch 'develop' into fix/read-receipts-ignore-deactivated-users
abhinavkrin Mar 10, 2026
5d4e979
requested changes
abhinavkrin Mar 10, 2026
d1ce974
requested changes
abhinavkrin Mar 11, 2026
39dfaff
minor improvement
abhinavkrin Mar 11, 2026
a8ae48d
requested changes
abhinavkrin Mar 11, 2026
2a3559f
requested changes
abhinavkrin Mar 13, 2026
0c6af04
requested changes
abhinavkrin Mar 13, 2026
7deda6b
refactor: apply PR review feedback
abhinavkrin Mar 18, 2026
f0aeb1f
style: run prettier to fix line length in tests
abhinavkrin Mar 18, 2026
8422dd9
Apply suggestion from @abhinavkrin
abhinavkrin Mar 19, 2026
05c8922
improved tests
abhinavkrin Apr 2, 2026
b8b2fc7
switched from aggregation to normal queries
abhinavkrin Apr 15, 2026
3f7a15c
update tests
abhinavkrin Apr 15, 2026
10ff7eb
minor changes
abhinavkrin Apr 15, 2026
d39e70a
fix: preserve dm archive behavior for other users on deactivation
abhinavkrin Apr 16, 2026
d8cd6f0
remove serActiveStatus.spec.ts
abhinavkrin Apr 16, 2026
5f83bc4
move files around
sampaiodiego Apr 16, 2026
cefe518
Merge branch 'develop' into fix/read-receipts-ignore-deactivated-users
abhinavkrin Apr 17, 2026
8dce836
lint
abhinavkrin Apr 17, 2026
bb860a7
Merge branch 'develop' into fix/read-receipts-ignore-deactivated-users
abhinavkrin Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor change
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
  • Loading branch information
abhinavkrin committed Mar 2, 2026
commit 6b40a462e1a9c553621c5c907b17d9b71c5a8821
14 changes: 8 additions & 6 deletions apps/meteor/app/lib/server/functions/setUserActiveStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ import {
notifyOnUserChange,
} from '../lib/notifyListener';

async function getArchivedRoomIdsForUser(userId: string): Promise<string[]> {
const subscriptions = await Subscriptions.findByUserId(userId, { projection: { rid: 1 } }).toArray();
const roomIds = subscriptions.map((sub) => sub.rid);
Comment thread
abhinavkrin marked this conversation as resolved.
Outdated
const archivedRooms = await Rooms.findArchivedByRoomIds(roomIds, { projection: { _id: 1 } }).toArray();
return archivedRooms.map((room) => room._id);
}

async function reactivateDirectConversations(userId: string) {
// since both users can be deactivated at the same time, we should just reactivate rooms if both users are active
// for that, we need to fetch the direct messages, fetch the users involved and then the ids of rooms we can reactivate
Expand Down Expand Up @@ -120,12 +127,7 @@ export async function setUserActiveStatus(
}

if (user.username && active === true && !user.active) {
// When reactivating, only unarchive subscriptions to non-archived rooms
const subscriptions = await Subscriptions.findByUserId(userId, { projection: { rid: 1 } }).toArray();
const roomIds = subscriptions.map((sub) => sub.rid);
const archivedRooms = await Rooms.findArchivedByRoomIds(roomIds, { projection: { _id: 1 } }).toArray();
const archivedRoomIds = archivedRooms.map((room) => room._id);

const archivedRoomIds = await getArchivedRoomIdsForUser(userId);
const { modifiedCount } = await Subscriptions.unarchiveByUsernameExcludingRoomIds(user.username, archivedRoomIds);
if (modifiedCount) {
void notifyOnSubscriptionChangedByUserId(userId);
Comment thread
abhinavkrin marked this conversation as resolved.
Outdated
Expand Down
Loading