Skip to content

[BUG]: Analytics page keeps the previous organization's pull request data after exploring a new org #272

Open

Description

@amanbn8

Bug Description

When you explore a new organization, explore() in src/context/AppContext.jsx resets the model, the org list and issuesData, but it never resets pullsData. Whatever pull request data was collected for the previous organization stays in state and is shown under the new one.

On the Analytics page this means:

  • The "Average PR Merge Time" and "Pull Request Acceptance Rate" cards show the previous org's numbers.
  • The repository dropdown in the Advanced Analytics section still lists the previous org's repositories.
  • Because hasPullsData is true, the "Collect Advanced Metrics" button is hidden. Without a PAT there is then no way to fetch pull data for the new org, since the banner's "Run Complete Analysis" needs a PAT.

The persist effect also writes the stale pullsData into the analysis cache together with the new org, so the wrong data comes back after a reload.

The reset block at the top of explore() is currently:

setLoading(true);
setError('');
setModel(null);
setOrgs([]);
setIssuesData({});
setLastOrgNames(orgNames);
setAuditComplete(false);
setAdvanceAnalyticsComplete(false);

There is no setPullsData({}). pullsData is only written by runAdvanceAnalytics, runFullAnalytics and the cache restore effect, so nothing else clears it either.

Steps to Reproduce

  1. With no PAT configured, explore AOSSIE-Org from the Quick explore buttons.
  2. Open Analytics and click "Collect Advanced Metrics". Wait for the merge time and acceptance rate cards to appear.
  3. Go back to Home and explore DjedAlliance.
  4. Open Analytics again.

Expected: the Advanced Analytics section is empty and offers "Collect Advanced Metrics" for DjedAlliance.

Actual: the Overview page correctly shows Djed Alliance with 35 repos, but the Analytics page still shows AOSSIE-Org's data. The repository dropdown lists Website, EduAid, Resonate, PictoPy, DebateAI, Agora-Blockchain, InPactAI, Devr.AI, Resonate-Website and BabyNest (all AOSSIE-Org repos), the cards read "14.2 Days" average merge time and "49.6 %" acceptance based on 273 merged / 277 rejected AOSSIE-Org pull requests, and the "Collect Advanced Metrics" button is gone. Reloading the page brings the same stale numbers back from the cache.

Logs and Screenshots

No console errors, the stale data just renders.

Environment Details

  • main at 95a980d, npm run dev
  • Chromium on macOS, no PAT configured

Impact

High - Major feature is broken

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

The fix looks like a one-liner: add setPullsData({}) to the reset block in explore(). I'd be happy to open a PR for it if this is confirmed.

Activity

  1. added
    bug
    on Sep 30, 2026
  2. gitcordapp commented on Sep 30, 2026

    @gitcordapp

    Link your account with Gitcord

    Thanks for opening this issue, @amanbn8!

    To receive Discord notifications and contributor tracking for this organization:

    1. Join Discord: https://discord.gg/hjUhu33uAn
    2. In Discord, run /link amanbn8
    3. Paste the verification code into your GitHub bio (or a public gist)
    4. Click Verify in Discord (or run /verify-link amanbn8)

    Once linked, Gitcord can notify you about assignments, mentions, and more.

    — Posted by Gitcord

  3. rahul-vyas-dev commented on Oct 1, 2026

    @rahul-vyas-dev
    Contributor

    If the issue is reproducible, then please attach screen recording of that to validate them.

  4. amanbn8 commented on Oct 1, 2026

    @amanbn8
    Author

    Here's a screen recording of the reproduction on main without a PAT: explore AOSSIE-Org, collect advanced metrics on the Analytics page, go back and explore DjedAlliance, then open Analytics again. The merge time, acceptance rate and repository dropdown are still AOSSIE-Org's, and the "Collect Advanced Metrics" button is gone. Picking "Website" from the dropdown shows that AOSSIE-Org repo's metrics while DjedAlliance is the organization being viewed.

    orgexplorer-272-stale-pull-data.webm

    The fix is in #279.

  5. added a commit that references this issue on Oct 6, 2026
    b22f10d
  6. Rajvardhan-Singh-Rathore commented on Oct 16, 2026

    @Rajvardhan-Singh-Rathore
    Contributor

    @amanbn8 are you still working on this ??

  7. amanbn8 commented on Oct 16, 2026

    @amanbn8
    Author

    @Rajvardhan-Singh-Rathore Yes , see #279 for the fix

  8. added a commit that references this issue on Oct 22, 2026
    dc9d50d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions