Skip to content

Dev to Main Sync#2606

Merged
prakashchoudhary07 merged 1 commit into
mainfrom
develop
Jul 21, 2026
Merged

Dev to Main Sync#2606
prakashchoudhary07 merged 1 commit into
mainfrom
develop

Conversation

@AnujChhikara

@AnujChhikara AnujChhikara commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Date: 21 July , 2026

Developer Name: @AnujChhikara


Issue Ticket Number

PRs going for sync

Description

Most reads scanned entire collections when only non-archived (active) users are needed. Switch the hot paths to active-users-first, paginated, batched reads.

GET /users/status:

Paginate non-archived users (fetchNonArchivedUsers, doc-id cursors) then batch-fetch their statuses (getUserStatusForUserIds, chunked in) instead of scanning all statuses with per-user lookups.
links.next/prev only emitted when a page exists in that direction.
Discord idle crons (group-idle, group-idle-7d):

Active-users-first: page non-archived users -> their statuses -> filter IDLE, avoiding stale IDLE statuses of archived users and per-user reads.
Fix 7-day idle calc: align the OOO fetch window with the idle-day window (idleFrom ?? currentStatus.from ?? now) so past OOO is excluded when idleFrom is missing.
Other:

getTaskBasedUsersStatus: per-user tasks query -> chunked in.
fetchAllUsers({ nonArchivedOnly }): active-only option, used by markUnverified and updateDiscordNicknames.
Reuse getPaginationLink util (basePath param) instead of a duplicate helper.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screen.Recording.2026-07-21.at.10.41.32.PM.mov
image

refactor: reduce Firestore reads on users & usersStatus collections
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 401dc874-2f0b-4061-aa15-4bc8633109ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@prakashchoudhary07
prakashchoudhary07 merged commit cd0182b into main Jul 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants