WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Jashan32
Copy link

@Jashan32 Jashan32 commented Dec 6, 2025

What kind of change does this PR introduce?
This pr fixes Search organization getting rate limited in admin portal by using a lightWeight query which does not have any unNecessary fields.

Issue Number: #4954

Fixes #4954

Snapshots/Videos:
No visual change other than user does does not gets rate limited often.

If relevant, did you update the documentation?
Auto docs updated it automatically

Does this PR introduce a breaking change?
No

Checklist

CodeRabbit AI Review

  • I have reviewed and addressed all critical issues flagged by CodeRabbit AI
  • I have implemented or provided justification for each non-critical suggestion
  • I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

Test Coverage

  • I have written tests for all new changes/features
  • I have verified that test coverage meets or exceeds 95%
  • I have run the test suite locally and all tests pass

Other information

Have you read the contributing guide?

Summary by CodeRabbit

  • Bug Fixes

    • Creation failures now keep the organization modal open and do not show a success message.
  • Behavioral Changes

    • Organization list fetching now uses filter-based results to improve displayed listings.
  • Tests

    • Added tests covering null-response scenarios during organization creation to validate modal behavior and notification suppression.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 6, 2025 11:19
@keploy
Copy link

keploy bot commented Dec 6, 2025

No significant changes currently retry

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

Our Pull Request Approval Process

This PR will be reviewed according to our:

  1. Palisadoes Contributing Guidelines

  2. AI Usage Policy

Your PR may be automatically closed if:

  1. Our PR template isn't filled in correctly

  2. You haven't correctly linked your PR to an issue

Thanks for contributing!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Replaced the GraphQL query constant used to fetch organizations from ORGANIZATION_LIST to ORGANIZATION_FILTER_LIST in the OrgList component, mocks, and tests. Added two test cases that assert behavior when CREATE_ORGANIZATION_MUTATION returns null (no success toast; modal remains open).

Changes

Cohort / File(s) Summary
Component & mocks
src/screens/OrgList/OrgList.tsx, src/screens/OrgList/OrgListMocks.ts
Swapped imported and referenced query constant from ORGANIZATION_LISTORGANIZATION_FILTER_LIST for organization fetching; adjusted mock request definitions to use ORGANIZATION_FILTER_LIST.
Tests
src/screens/OrgList/OrgList.spec.tsx
Updated imports and all mock constructions to use ORGANIZATION_FILTER_LIST instead of ORGANIZATION_LIST. Added two tests verifying creation flow when CREATE_ORGANIZATION_MUTATION returns data: null (assert no success toast and modal remains open).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus:
    • src/screens/OrgList/OrgList.tsx — confirm variables/filters and fetchPolicy remain appropriate with the new query.
    • src/screens/OrgList/OrgListMocks.ts and src/screens/OrgList/OrgList.spec.tsx — ensure mocks map correctly to ORGANIZATION_FILTER_LIST and new null-response test cases simulate real mutation responses.
    • Verify there are no remaining references to ORGANIZATION_LIST that could cause runtime/test mismatches.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The code changes partially address #4954 by switching OrgList.tsx to use ORGANIZATION_FILTER_LIST, but test mocks in OrgListMocks.ts still contain mismatched variables that will cause test failures. Update OrgListMocks.ts to use ORGANIZATION_FILTER_LIST with only { filter: '' } variables throughout, removing unused parameters like first, skip, orderBy to match the lightweight query signature.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the bug fix: switching from a heavyweight query to a lightweight one to resolve rate limiting issues in organization search.
Description check ✅ Passed The description is mostly complete with issue reference, problem explanation, and checklist items present. However, test coverage checklist items remain unchecked.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the rate limiting issue: switching from ORGANIZATION_LIST to ORGANIZATION_FILTER_LIST in component and test files, plus adding test cases for null data handling.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef9e68d and fb434af.

⛔ Files ignored due to path filters (1)
  • docs/docs/auto-docs/screens/OrgList/OrgListMocks/variables/MOCKS_ADMIN.md is excluded by !**/docs/docs/**
📒 Files selected for processing (1)
  • src/screens/OrgList/OrgListMocks.ts (5 hunks)
🧰 Additional context used
🧠 Learnings (17)
📓 Common learnings
Learnt from: Bittukr7479
Repo: PalisadoesFoundation/talawa-admin PR: 3806
File: src/screens/OrganizationFunds/OrganizationFunds.spec.tsx:0-0
Timestamp: 2025-03-23T02:43:56.939Z
Learning: In the talawa-admin project, the search functionality test for Organization Funds was temporarily disabled during the PostgreSQL migration because the underlying API was not working. The test will be re-enabled or updated once the API is fixed.
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Learnt from: Piyushk8
Repo: PalisadoesFoundation/talawa-admin PR: 3877
File: src/GraphQl/Queries/OrganizationQueries.ts:133-166
Timestamp: 2025-03-25T14:28:21.436Z
Learning: The user plans to address pagination inconsistencies and consolidate duplicate GraphQL queries (like USER_JOINED_ORGANIZATIONS_PG) in a future PR focused specifically on pagination fixes across the application.
Learnt from: PratapRathi
Repo: PalisadoesFoundation/talawa-admin PR: 3923
File: src/GraphQl/Queries/Queries.ts:62-73
Timestamp: 2025-04-09T05:00:49.395Z
Learning: The ORGANIZATION_LIST_BY_SEARCH query in src/GraphQl/Queries/Queries.ts relies on search filtering rather than pagination to manage result set size, with the team planning to add limits later if needed.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-11T11:51:09.236Z
Learning: In talawa-admin PR #4664 (continuation of PR #4565 sharding work), global mock cleanup was implemented via vi.clearAllMocks() in vitest.setup.ts afterEach, along with Apollo Client warning suppression (temporary, pending follow-up PR) and test suite refactoring to per-test StaticMockLink instances. This test isolation strategy addresses mock state leakage that forced maxConcurrency: 1 in PR #4565, enabling future parallel test execution improvements and 3-4x speedup potential.
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts:0-0
Timestamp: 2025-10-22T22:00:53.943Z
Learning: In src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts (and similar mock files), avoid duplicating identical Apollo MockedProvider mocks for repeated query consumption. Prefer adding `maxUsageCount` to the existing mock or using `newData` for reusable responses to keep tests deterministic and reduce drift.
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2355
File: src/GraphQl/Queries/userTagQueries.ts:111-115
Timestamp: 2024-10-25T19:27:07.624Z
Learning: In the Talawa Admin project, when constructing GraphQL queries (e.g., in `src/GraphQl/Queries/userTagQueries.ts`), only query the required user fields necessary for functionality to minimize data transfer and maintain efficiency.
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/OrganizationActionItems/testObject.mocks.ts:184-402
Timestamp: 2024-11-01T12:54:20.857Z
Learning: In `src/screens/OrganizationActionItems/testObject.mocks.ts`, test failures are not dependent on the `createdAt` fields; hardcoded dates in `createdAt` fields do not cause test failures in this file.
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:409-0
Timestamp: 2025-08-20T18:04:34.194Z
Learning: In PR #4094, the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modification for initial implementation, with plans to refactor for consistency later.
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:435-0
Timestamp: 2025-08-20T18:04:23.118Z
Learning: In the talawa-admin codebase, pagination logic for the admin orglist page in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications to maintain consistency between the two implementations.
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4068
File: src/GraphQl/Queries/Queries.ts:636-644
Timestamp: 2025-08-08T08:14:51.613Z
Learning: In the talawa-admin project, GraphQL queries that call organization(input: { id }) expect the variable $id to be typed as String! (not ID!). Keep $id: String! for queries like GET_ORGANIZATION_BASIC_DATA, GET_ORGANIZATION_MEMBERS_PG, and GET_ORGANIZATION_POSTS_PG in src/GraphQl/Queries/Queries.ts.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-25T20:17:39.986Z
Learning: In PR #4815, the ORGANIZATION_POST_LIST_WITH_VOTES GraphQL query in src/GraphQl/Queries/OrganizationQueries.ts is missing the `attachments` field (with mimeType, name, fileHash, objectName subfields) which is required for rendering post media (images/videos) in the PostCard component.
📚 Learning: 2025-10-22T22:00:53.943Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts:0-0
Timestamp: 2025-10-22T22:00:53.943Z
Learning: In src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts (and similar mock files), avoid duplicating identical Apollo MockedProvider mocks for repeated query consumption. Prefer adding `maxUsageCount` to the existing mock or using `newData` for reusable responses to keep tests deterministic and reduce drift.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-04-09T05:00:49.395Z
Learnt from: PratapRathi
Repo: PalisadoesFoundation/talawa-admin PR: 3923
File: src/GraphQl/Queries/Queries.ts:62-73
Timestamp: 2025-04-09T05:00:49.395Z
Learning: The ORGANIZATION_LIST_BY_SEARCH query in src/GraphQl/Queries/Queries.ts relies on search filtering rather than pagination to manage result set size, with the team planning to add limits later if needed.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-08-20T18:04:34.194Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:409-0
Timestamp: 2025-08-20T18:04:34.194Z
Learning: In PR #4094, the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modification for initial implementation, with plans to refactor for consistency later.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-08-20T18:04:52.324Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-08-20T18:04:23.118Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:435-0
Timestamp: 2025-08-20T18:04:23.118Z
Learning: In the talawa-admin codebase, pagination logic for the admin orglist page in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications to maintain consistency between the two implementations.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2024-11-01T12:54:20.857Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/OrganizationActionItems/testObject.mocks.ts:184-402
Timestamp: 2024-11-01T12:54:20.857Z
Learning: In `src/screens/OrganizationActionItems/testObject.mocks.ts`, test failures are not dependent on the `createdAt` fields; hardcoded dates in `createdAt` fields do not cause test failures in this file.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-11-21T12:42:24.884Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4718
File: src/components/EventManagement/Dashboard/EventDashboard.mocks.ts:83-114
Timestamp: 2025-11-21T12:42:24.884Z
Learning: In talawa-admin mock files (e.g., EventDashboard.mocks.ts), mock constant names must accurately reflect what they test. Mock names suggesting role-based logic (e.g., MOCKS_WITH_ADMIN_ROLE) are misleading when the component derives role from localStorage rather than mock data. Name mocks based on their distinguishing data features (e.g., MOCKS_WITH_SINGLE_ATTENDEE) or test context (e.g., MOCKS_FOR_ADMIN_STORAGE_TEST).

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-01-15T05:39:30.480Z
Learnt from: arpit-chakraborty
Repo: PalisadoesFoundation/talawa-admin PR: 3158
File: src/screens/OrganizationTags/OrganizationTagsMocks.ts:384-524
Timestamp: 2025-01-15T05:39:30.480Z
Learning: In OrganizationTagsMocks.ts, MOCKS_NULL_END_CURSOR and MOCKS_NO_MORE_PAGES are designed to test UI handling of edge cases where pagination data is inconsistent (e.g., hasNextPage is true but endCursor is null, or next page returns undefined data).

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2024-10-25T19:31:37.405Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2355
File: src/screens/ManageTag/ManageTagMocks.ts:187-269
Timestamp: 2024-10-25T19:31:37.405Z
Learning: In `src/screens/ManageTag/ManageTagMocks.ts`, when mocking data for `USER_TAGS_ASSIGNED_MEMBERS` and `USER_TAGS_MEMBERS_TO_ASSIGN_TO`, it's acceptable for user IDs to overlap because the queries serve different purposes and the overlapping IDs can represent realistic scenarios in tests.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-11-08T18:14:54.607Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4622
File: src/screens/OrgPost/OrgPost.tsx:109-122
Timestamp: 2025-11-08T18:14:54.607Z
Learning: In src/screens/OrgPost/OrgPost.tsx, the refetchPinnedPosts function from the ORGANIZATION_PINNED_POST_LIST query is intentionally left commented out because the entire page is set to reload when posts are deleted, unpinned, or pinned, making a separate refetch unnecessary.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2024-06-30T21:17:16.481Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2064
File: src/screens/OrganizationFundCampaign/CampaignDeleteModal.tsx:4-5
Timestamp: 2024-06-30T21:17:16.481Z
Learning: The folder containing mutation queries in the codebase is named `GraphQl`, not `graphql`.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-03-25T14:28:21.436Z
Learnt from: Piyushk8
Repo: PalisadoesFoundation/talawa-admin PR: 3877
File: src/GraphQl/Queries/OrganizationQueries.ts:133-166
Timestamp: 2025-03-25T14:28:21.436Z
Learning: The user plans to address pagination inconsistencies and consolidate duplicate GraphQL queries (like USER_JOINED_ORGANIZATIONS_PG) in a future PR focused specifically on pagination fixes across the application.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-08-08T08:14:51.613Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4068
File: src/GraphQl/Queries/Queries.ts:636-644
Timestamp: 2025-08-08T08:14:51.613Z
Learning: In the talawa-admin project, GraphQL queries that call organization(input: { id }) expect the variable $id to be typed as String! (not ID!). Keep $id: String! for queries like GET_ORGANIZATION_BASIC_DATA, GET_ORGANIZATION_MEMBERS_PG, and GET_ORGANIZATION_POSTS_PG in src/GraphQl/Queries/Queries.ts.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-04-18T23:57:31.855Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/AdvertisementsMocks.ts:11-16
Timestamp: 2025-04-18T23:57:31.855Z
Learning: In the talawa-admin project, barrel files (mutations.ts and Queries.ts) are used as a centralized export mechanism that re-export constants from specific module files. For example, mutations.ts re-exports advertisement mutations from AdvertisementMutations.ts, and Queries.ts re-exports query constants like ORGANIZATION_ADVERTISEMENT_LIST from their respective specific modules. This pattern simplifies imports by allowing consumers to import from a single path.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-04-18T23:57:31.855Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/AdvertisementsMocks.ts:11-16
Timestamp: 2025-04-18T23:57:31.855Z
Learning: In the talawa-admin project, barrel files (like mutations.ts and Queries.ts) are used as a centralized export mechanism to re-export constants from specific module files. This pattern simplifies imports and provides a cleaner API by allowing consumers to import from a single path rather than knowing the exact file structure. For example, Queries.ts re-exports ORGANIZATION_ADVERTISEMENT_LIST from AdvertisementQueries.ts, maintaining a consistent import path for consumers.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
📚 Learning: 2025-02-07T13:00:35.500Z
Learnt from: hustlernik
Repo: PalisadoesFoundation/talawa-admin PR: 3534
File: src/GraphQl/Queries/Queries.ts:388-395
Timestamp: 2025-02-07T13:00:35.500Z
Learning: The `GET_ORGANIZATION_POSTS_PG` query is designed to fetch only a few recent posts using the `first` parameter, and pagination is intentionally omitted as it's not required for this use case.

Applied to files:

  • src/screens/OrgList/OrgListMocks.ts
🧬 Code graph analysis (1)
src/screens/OrgList/OrgListMocks.ts (1)
src/GraphQl/Queries/Queries.ts (1)
  • ORGANIZATION_FILTER_LIST (76-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Generate and Validate Documentation
  • GitHub Check: Check Python Code Style
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (1)
src/screens/OrgList/OrgListMocks.ts (1)

7-10: Mocks now correctly aligned to ORGANIZATION_FILTER_LIST with consistent variables

Importing ORGANIZATION_FILTER_LIST and updating all related mocks to use query: ORGANIZATION_FILTER_LIST with variables: { filter: '' } keeps the test layer in sync with the lighter query and avoids the earlier query/variable mismatch that would break Apollo MockedProvider matching. This should eliminate the previous “extra variables” issue in MOCKS_ADMIN and help prevent rate-limit regressions by ensuring tests exercise the new lightweight path.

Also applies to: 86-95, 219-222, 308-311, 328-331


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 and usage tips.

@codecov
Copy link

codecov bot commented Dec 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.36%. Comparing base (1f9f7bb) to head (fb434af).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4955   +/-   ##
========================================
  Coverage    95.36%   95.36%           
========================================
  Files          387      387           
  Lines        15057    15057           
  Branches      4532     4532           
========================================
  Hits         14359    14359           
  Misses         670      670           
  Partials        28       28           
Flag Coverage Δ
vitest 95.36% <100.00%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses rate limiting issues in the organization search functionality by replacing the heavy ORGANIZATION_LIST query with a lightweight ORGANIZATION_FILTER_LIST query. The key optimization is eliminating the expensive members(first: 32) field fetch and replacing it with a simple isMember boolean flag.

  • Replaced ORGANIZATION_LIST query with ORGANIZATION_FILTER_LIST in OrgList component
  • Updated all test mocks to use the new lightweight query
  • Added test coverage for null data response during organization creation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/screens/OrgList/OrgList.tsx Updated imports and useQuery hook to use ORGANIZATION_FILTER_LIST instead of ORGANIZATION_LIST, reducing query complexity to prevent rate limiting
src/screens/OrgList/OrgList.spec.tsx Updated all test mocks to use ORGANIZATION_FILTER_LIST query and added new test case for null data response during organization creation
docs/docs/auto-docs/screens/OrgList/OrgList/functions/default.md Auto-generated documentation update reflecting the line number change in source file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@palisadoes
Copy link
Contributor

@coderabbitai full review and reevaluate all resolved items. If the PR requires any changes, even trivial ones, then give your review a “requested changes” status. If no changes are required then give the PR an “approved” status.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes required: Test mocks in OrgListMocks.ts need to be updated from ORGANIZATION_LIST to ORGANIZATION_FILTER_LIST to match the component changes. See detailed review comment for specific changes needed.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get the PR diff to see actual changes
gh pr diff 4955 --repo PalisadoesFoundation/talawa-admin

Length of output: 9374


🏁 Script executed:

#!/bin/bash
# Find and examine the ORGANIZATION_FILTER_LIST query definition
rg -n "ORGANIZATION_FILTER_LIST\s*=" --type=ts -A 30

Length of output: 1643


🏁 Script executed:

#!/bin/bash
# Find and examine the ORGANIZATION_LIST query definition for comparison
rg -n "export const ORGANIZATION_LIST\s*=" --type=ts -A 30

Length of output: 1720


🏁 Script executed:

#!/bin/bash
# Check all usages of ORGANIZATION_LIST to see if any other places need updating
rg -n "ORGANIZATION_LIST" --type=ts -C 2

Length of output: 24878


🏁 Script executed:

#!/bin/bash
# Get the full content of the modified files to understand context
cat src/screens/OrgList/OrgList.tsx

Length of output: 18412


🏁 Script executed:

#!/bin/bash
cat src/screens/OrgList/OrgList.spec.tsx

Length of output: 62323


🏁 Script executed:

#!/bin/bash
# Get the full content of OrgListMocks.ts to verify it needs updating
cat src/screens/OrgList/OrgListMocks.ts

Length of output: 7306


🏁 Script executed:

#!/bin/bash
# Check if there are any references to ORG_FIELDS fragment to understand what fields are included
rg -n "ORG_FIELDS\s*=" --type=ts -A 20

Length of output: 1178


🏁 Script executed:

#!/bin/bash
# Verify the ORGANIZATION_FILTER_LIST query is properly exported
rg -n "export.*ORGANIZATION_FILTER_LIST" --type=ts

Length of output: 78


@palisadoes, I've completed a comprehensive review of PR #4955. I found a critical issue that will cause test failures.

Critical Issue: Test Mocks Not Updated

The component file OrgList.tsx correctly switched to ORGANIZATION_FILTER_LIST, but OrgListMocks.ts was not updated and still uses ORGANIZATION_LIST. This creates a query mismatch that will cause tests to fail.

Required Changes

File: src/screens/OrgList/OrgListMocks.ts

  1. Update the import statement (line 7):
// Change from:
import {
  CURRENT_USER,
  ORGANIZATION_LIST,
  USER_ORGANIZATION_LIST,
  ALL_ORGANIZATIONS_PG,
} from 'GraphQl/Queries/Queries';

// To:
import {
  CURRENT_USER,
  ORGANIZATION_FILTER_LIST,
  USER_ORGANIZATION_LIST,
  ALL_ORGANIZATIONS_PG,
} from 'GraphQl/Queries/Queries';
  1. Update MOCKS array (line 87):
// Change from:
{
  request: {
    query: ORGANIZATION_LIST,
    variables: { filter: '' },
  },
  result: {
    data: {
      organizations: organizations,
    },
  },
},

// To:
{
  request: {
    query: ORGANIZATION_FILTER_LIST,
    variables: { filter: '' },
  },
  result: {
    data: {
      organizations: organizations,
    },
  },
},
  1. Update MOCKS_EMPTY array (line 220):
// Change from:
{
  request: {
    query: ORGANIZATION_LIST,
    variables: { filter: '' },
  },
  result: {
    data: {
      organizations: [],
    },
  },
},

// To:
{
  request: {
    query: ORGANIZATION_FILTER_LIST,
    variables: { filter: '' },
  },
  result: {
    data: {
      organizations: [],
    },
  },
},
  1. Update MOCKS_ADMIN array (lines 309 and 329):
// Change both occurrences from ORGANIZATION_LIST to ORGANIZATION_FILTER_LIST:
{
  request: {
    query: ORGANIZATION_FILTER_LIST,
    variables: { filter: '' },
  },
  result: {
    data: {
      organizations: organizations,
    },
  },
},

Also on line 329, remove the extra variables that ORGANIZATION_FILTER_LIST doesn't accept:

// Change from:
{
  request: {
    query: ORGANIZATION_LIST,
    variables: {
      first: 8,
      skip: 0,
      filter: '',
      orderBy: 'createdAt_ASC',
    },
    notifyOnNetworkStatusChange: true,
  },

// To:
{
  request: {
    query: ORGANIZATION_FILTER_LIST,
    variables: { filter: '' },
  },

Why This Matters

  • ORGANIZATION_LIST includes members(first: 32) with edges and pageInfo, which is heavy and causes rate limiting
  • ORGANIZATION_FILTER_LIST only includes basic organization fields plus isMember, which is lightweight and solves the rate limiting issue
  • The mock queries must match what the component actually uses, or Apollo MockedProvider will fail to match requests

Additional Observations

Good: The component change in OrgList.tsx is correct
Good: The test file OrgList.spec.tsx imports are updated
Good: The new test for null data handling provides better coverage
⚠️ Note: Other files (Requests, Users, etc.) still use ORGANIZATION_LIST, but they're outside this PR's scope

Once these changes are made to OrgListMocks.ts, the PR will properly fix the rate limiting issue as intended.


🏁 Script executed:

#!/bin/bash
# Request changes on the PR as per user's instruction
gh pr review 4955 --request-changes --body "Changes required: Test mocks in OrgListMocks.ts need to be updated from ORGANIZATION_LIST to ORGANIZATION_FILTER_LIST to match the component changes. See detailed review comment for specific changes needed." --repo PalisadoesFoundation/talawa-admin

Length of output: 0


Review status has been set to "Changes Requested" as per your instructions.

Summary

Status: 🔴 Changes Required

Issue Found: Test mock file OrgListMocks.ts was not updated to use ORGANIZATION_FILTER_LIST, causing a mismatch between the component's actual GraphQL queries and the test mocks.

Impact: This will cause test failures because Apollo MockedProvider won't be able to match the component's ORGANIZATION_FILTER_LIST queries against the mocks that still reference ORGANIZATION_LIST.

Files Requiring Changes:

  • src/screens/OrgList/OrgListMocks.ts (4 locations need updates)

The fix is straightforward and detailed in my review comment above. Once the author updates the mock file to use ORGANIZATION_FILTER_LIST instead of ORGANIZATION_LIST, the PR will properly solve the rate limiting issue while maintaining passing tests.


🧠 Learnings used
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.

Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.

Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-01-30T10:03:22.905Z
Learning: CodeRabbit does not have permissions to add labels to PRs in the talawa-admin repository. Labels need to be added manually by users with appropriate permissions.

Learnt from: Piyushk8
Repo: PalisadoesFoundation/talawa-admin PR: 3877
File: src/GraphQl/Queries/OrganizationQueries.ts:133-166
Timestamp: 2025-03-25T14:28:21.436Z
Learning: The user plans to address pagination inconsistencies and consolidate duplicate GraphQL queries (like USER_JOINED_ORGANIZATIONS_PG) in a future PR focused specifically on pagination fixes across the application.

Learnt from: Bittukr7479
Repo: PalisadoesFoundation/talawa-admin PR: 3806
File: src/screens/OrganizationFunds/OrganizationFunds.spec.tsx:0-0
Timestamp: 2025-03-23T02:43:56.939Z
Learning: In the talawa-admin project, the search functionality test for Organization Funds was temporarily disabled during the PostgreSQL migration because the underlying API was not working. The test will be re-enabled or updated once the API is fixed.

Learnt from: PratapRathi
Repo: PalisadoesFoundation/talawa-admin PR: 3923
File: src/GraphQl/Queries/Queries.ts:62-73
Timestamp: 2025-04-09T05:00:49.395Z
Learning: The ORGANIZATION_LIST_BY_SEARCH query in src/GraphQl/Queries/Queries.ts relies on search filtering rather than pagination to manage result set size, with the team planning to add limits later if needed.

Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2355
File: src/GraphQl/Queries/userTagQueries.ts:111-115
Timestamp: 2024-10-25T19:27:07.624Z
Learning: In the Talawa Admin project, when constructing GraphQL queries (e.g., in `src/GraphQl/Queries/userTagQueries.ts`), only query the required user fields necessary for functionality to minimize data transfer and maintain efficiency.

Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.

Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.

Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-25T20:17:39.986Z
Learning: In PR #4815, the ORGANIZATION_POST_LIST_WITH_VOTES GraphQL query in src/GraphQl/Queries/OrganizationQueries.ts is missing the `attachments` field (with mimeType, name, fileHash, objectName subfields) which is required for rendering post media (images/videos) in the PostCard component.

Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:409-0
Timestamp: 2025-08-20T18:04:34.194Z
Learning: In PR #4094, the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modification for initial implementation, with plans to refactor for consistency later.

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply this change

@palisadoes
Copy link
Contributor

@coderabbitai full review and reevaluate all resolved items. If the PR requires any changes, even trivial ones, then give your review a “requested changes” status. If no changes are required then give the PR an “approved” status.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! One remaining issue in OrgListMocks.ts needs to be fixed - see detailed comment.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get the current PR diff to see what files have been changed
gh pr diff 4955 --repo PalisadoesFoundation/talawa-admin

Length of output: 10729


🏁 Script executed:

#!/bin/bash
# Check if OrgListMocks.ts has been modified in this PR
gh pr view 4955 --repo PalisadoesFoundation/talawa-admin --json files --jq '.files[].path'

Length of output: 169


🏁 Script executed:

#!/bin/bash
# Get the content of OrgListMocks.ts to verify if it needs updating
cat src/screens/OrgList/OrgListMocks.ts

Length of output: 7341


🏁 Script executed:

#!/bin/bash
# Verify the ORGANIZATION_FILTER_LIST query definition to understand what fields it includes
rg -n "export const ORGANIZATION_FILTER_LIST\s*=" --type=ts -A 30

Length of output: 1643


🏁 Script executed:

#!/bin/bash
# Check if there are any other files that might need updating
rg -n "ORGANIZATION_LIST[^_A-Z]" --type=ts src/screens/OrgList/

Length of output: 140


🏁 Script executed:

#!/bin/bash
# Request changes on the PR for the remaining issue
gh pr review 4955 --request-changes --body "Almost there! One remaining issue in OrgListMocks.ts needs to be fixed - see detailed comment." --repo PalisadoesFoundation/talawa-admin

Length of output: 0


@palisadoes, I've completed the full review. Great progress! The PR author has addressed most of the issues I previously identified. However, there is one remaining issue that needs to be fixed.

✅ What's Fixed

The PR author has successfully updated:

  • OrgList.tsx - correctly uses ORGANIZATION_FILTER_LIST
  • OrgList.spec.tsx - all test imports and mocks updated
  • OrgListMocks.ts - imports and most mocks updated

❌ Remaining Issue

File: src/screens/OrgList/OrgListMocks.ts (Line 328-340)

The second mock in MOCKS_ADMIN array still has incorrect variables that don't match the ORGANIZATION_FILTER_LIST query signature:

Current code (incorrect):

{
  request: {
    query: ORGANIZATION_FILTER_LIST,
    variables: {
      first: 8,
      skip: 0,
      filter: '',
      orderBy: 'createdAt_ASC',
    },
    notifyOnNetworkStatusChange: true,
  },
  result: {
    data: {
      organizations: organizations,
    },
  },
},

Should be:

{
  request: {
    query: ORGANIZATION_FILTER_LIST,
    variables: { filter: '' },
  },
  result: {
    data: {
      organizations: organizations,
    },
  },
},

Why This Matters

The ORGANIZATION_FILTER_LIST query is defined as:

query OrganizationFilterList($filter: String) {
  organizations(filter: $filter) {
    ...OrgFields
    isMember
  }
}

It only accepts the filter variable. The extra variables (first, skip, orderBy, notifyOnNetworkStatusChange) will cause Apollo's MockedProvider to fail matching this mock during tests, as it performs exact matching on the request variables.

Action Required

Remove the extra variables from the mock at line 328-340 in src/screens/OrgList/OrgListMocks.ts. Keep only variables: { filter: '' }.

Once this is fixed, the PR will properly solve the rate limiting issue while maintaining passing tests! 🎯


Review Status: 🔴 Changes Requested


🧠 Learnings used
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.

Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.

Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.

Learnt from: Piyushk8
Repo: PalisadoesFoundation/talawa-admin PR: 3877
File: src/GraphQl/Queries/OrganizationQueries.ts:133-166
Timestamp: 2025-03-25T14:28:21.436Z
Learning: The user plans to address pagination inconsistencies and consolidate duplicate GraphQL queries (like USER_JOINED_ORGANIZATIONS_PG) in a future PR focused specifically on pagination fixes across the application.

Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:409-0
Timestamp: 2025-08-20T18:04:34.194Z
Learning: In PR #4094, the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modification for initial implementation, with plans to refactor for consistency later.

Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.

Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:435-0
Timestamp: 2025-08-20T18:04:23.118Z
Learning: In the talawa-admin codebase, pagination logic for the admin orglist page in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications to maintain consistency between the two implementations.

Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-01-30T10:03:22.905Z
Learning: CodeRabbit does not have permissions to add labels to PRs in the talawa-admin repository. Labels need to be added manually by users with appropriate permissions.

Learnt from: Bittukr7479
Repo: PalisadoesFoundation/talawa-admin PR: 3806
File: src/screens/OrganizationFunds/OrganizationFunds.spec.tsx:0-0
Timestamp: 2025-03-23T02:43:56.939Z
Learning: In the talawa-admin project, the search functionality test for Organization Funds was temporarily disabled during the PostgreSQL migration because the underlying API was not working. The test will be re-enabled or updated once the API is fixed.

Learnt from: PratapRathi
Repo: PalisadoesFoundation/talawa-admin PR: 3923
File: src/GraphQl/Queries/Queries.ts:62-73
Timestamp: 2025-04-09T05:00:49.395Z
Learning: The ORGANIZATION_LIST_BY_SEARCH query in src/GraphQl/Queries/Queries.ts relies on search filtering rather than pagination to manage result set size, with the team planning to add limits later if needed.

Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2355
File: src/GraphQl/Queries/userTagQueries.ts:111-115
Timestamp: 2024-10-25T19:27:07.624Z
Learning: In the Talawa Admin project, when constructing GraphQL queries (e.g., in `src/GraphQl/Queries/userTagQueries.ts`), only query the required user fields necessary for functionality to minimize data transfer and maintain efficiency.

Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-25T20:17:39.986Z
Learning: In PR #4815, the ORGANIZATION_POST_LIST_WITH_VOTES GraphQL query in src/GraphQl/Queries/OrganizationQueries.ts is missing the `attachments` field (with mimeType, name, fileHash, objectName subfields) which is required for rendering post media (images/videos) in the PostCard component.

@palisadoes
Copy link
Contributor

@coderabbitai full review and reevaluate all resolved items. If the PR requires any changes, even trivial ones, then give your review a “requested changes” status. If no changes are required then give the PR an “approved” status.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All issues have been resolved! The PR correctly fixes the rate limiting issue by switching to ORGANIZATION_FILTER_LIST, and all test mocks have been properly updated to match the query signature. Great work!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get the latest PR diff to see current state of all changes
gh pr diff 4955 --repo PalisadoesFoundation/talawa-admin

Length of output: 14089


🏁 Script executed:

#!/bin/bash
# Get the full current content of OrgListMocks.ts to verify the fix
cat src/screens/OrgList/OrgListMocks.ts

Length of output: 7216


🏁 Script executed:

#!/bin/bash
# Verify ORGANIZATION_FILTER_LIST query signature to confirm it only accepts filter variable
rg -n "export const ORGANIZATION_FILTER_LIST" --type=ts -A 15

Length of output: 891


🏁 Script executed:

#!/bin/bash
# Approve the PR as all issues have been resolved
gh pr review 4955 --approve --body "All issues have been resolved! The PR correctly fixes the rate limiting issue by switching to ORGANIZATION_FILTER_LIST, and all test mocks have been properly updated to match the query signature. Great work!" --repo PalisadoesFoundation/talawa-admin

Length of output: 0


@palisadoes, excellent news! 🎉

✅ All Issues Resolved - PR Approved

I've completed a comprehensive review of PR #4955 and all previously identified issues have been fixed. The PR has been approved.

What Was Fixed

The critical issue in OrgListMocks.ts (line 328-340) has been properly resolved:

Before (incorrect):

{
  request: {
    query: ORGANIZATION_LIST,
    variables: {
      first: 8,
      skip: 0,
      filter: '',
      orderBy: 'createdAt_ASC',
    },
    notifyOnNetworkStatusChange: true,
  },
  ...
}

After (correct):

{
  request: {
    query: ORGANIZATION_FILTER_LIST,
    variables: { filter: '' },
  },
  ...
}

Summary of Changes

OrgList.tsx - Correctly uses ORGANIZATION_FILTER_LIST instead of ORGANIZATION_LIST
OrgList.spec.tsx - All imports and test mocks updated
OrgListMocks.ts - All four mock locations properly updated:

  • MOCKS array (line 84-93)
  • MOCKS_EMPTY array (line 217-226)
  • MOCKS_ADMIN array, first occurrence (line 306-315)
  • MOCKS_ADMIN array, second occurrence (line 326-334) - NOW FIXED

Why This Matters

The PR is ready to merge! 🚀


Review Status: ✅ Approved


🧠 Learnings used
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.

Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.

Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.

Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-25T20:17:39.986Z
Learning: In PR #4815, the ORGANIZATION_POST_LIST_WITH_VOTES GraphQL query in src/GraphQl/Queries/OrganizationQueries.ts is missing the `attachments` field (with mimeType, name, fileHash, objectName subfields) which is required for rendering post media (images/videos) in the PostCard component.

Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:409-0
Timestamp: 2025-08-20T18:04:34.194Z
Learning: In PR #4094, the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modification for initial implementation, with plans to refactor for consistency later.

Learnt from: Piyushk8
Repo: PalisadoesFoundation/talawa-admin PR: 3877
File: src/GraphQl/Queries/OrganizationQueries.ts:133-166
Timestamp: 2025-03-25T14:28:21.436Z
Learning: The user plans to address pagination inconsistencies and consolidate duplicate GraphQL queries (like USER_JOINED_ORGANIZATIONS_PG) in a future PR focused specifically on pagination fixes across the application.

Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-01-30T10:03:22.905Z
Learning: CodeRabbit does not have permissions to add labels to PRs in the talawa-admin repository. Labels need to be added manually by users with appropriate permissions.

Learnt from: Bittukr7479
Repo: PalisadoesFoundation/talawa-admin PR: 3806
File: src/screens/OrganizationFunds/OrganizationFunds.spec.tsx:0-0
Timestamp: 2025-03-23T02:43:56.939Z
Learning: In the talawa-admin project, the search functionality test for Organization Funds was temporarily disabled during the PostgreSQL migration because the underlying API was not working. The test will be re-enabled or updated once the API is fixed.

Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.

Learnt from: PratapRathi
Repo: PalisadoesFoundation/talawa-admin PR: 3923
File: src/GraphQl/Queries/Queries.ts:62-73
Timestamp: 2025-04-09T05:00:49.395Z
Learning: The ORGANIZATION_LIST_BY_SEARCH query in src/GraphQl/Queries/Queries.ts relies on search filtering rather than pagination to manage result set size, with the team planning to add limits later if needed.

Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2355
File: src/GraphQl/Queries/userTagQueries.ts:111-115
Timestamp: 2024-10-25T19:27:07.624Z
Learning: In the Talawa Admin project, when constructing GraphQL queries (e.g., in `src/GraphQl/Queries/userTagQueries.ts`), only query the required user fields necessary for functionality to minimize data transfer and maintain efficiency.

Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-06T05:15:51.829Z
Learning: In talawa-admin PR #4565, test sharding implementation achieved 2x speedup (8min → 4min) with conservative settings (maxConcurrency: 1, concurrent: false, maxThreads: 2 in CI) due to test isolation issues across 269 test files. These settings prevent OOM and race conditions. Higher speedup (3-4x) is achievable but requires systematic test isolation improvements. Apollo Client addTypename={false} deprecation warnings (142 files) are suppressed with TODO for follow-up fixes.

Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-11T11:51:09.236Z
Learning: In talawa-admin PR #4664 (continuation of PR #4565 sharding work), global mock cleanup was implemented via vi.clearAllMocks() in vitest.setup.ts afterEach, along with Apollo Client warning suppression (temporary, pending follow-up PR) and test suite refactoring to per-test StaticMockLink instances. This test isolation strategy addresses mock state leakage that forced maxConcurrency: 1 in PR #4565, enabling future parallel test execution improvements and 3-4x speedup potential.

@palisadoes palisadoes merged commit 63bba8d into PalisadoesFoundation:develop Dec 6, 2025
38 checks passed
@Jashan32 Jashan32 deleted the fix/rateLimitedSearch branch December 7, 2025 18:54
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