Skip to content

fix: use local repoRes.data instead of stale repoData in issue count fallback#150

Open
hconsulting987654321-blip wants to merge 1 commit intoentrius:testfrom
hconsulting987654321-blip:fix/stale-closure-repo-check
Open

fix: use local repoRes.data instead of stale repoData in issue count fallback#150
hconsulting987654321-blip wants to merge 1 commit intoentrius:testfrom
hconsulting987654321-blip:fix/stale-closure-repo-check

Conversation

@hconsulting987654321-blip
Copy link
Copy Markdown

Summary

In RepositoryCheckTab.tsx, the catch block for issue count fetching (line 95) references the repoData state variable. Inside the useEffect async callback, this is a stale closure value — null on first render since setRepoData() is async and the state hasn't updated yet. The fallback to open_issues_count never triggers.

Changes

Replace repoData with the local repoRes.data variable which is already available in the same scope and holds the freshly fetched data.

The eslint-disable-next-line react-hooks/exhaustive-deps comment on line 110 is a further signal that dependency tracking was intentionally loosened, masking this stale reference.

…fallback

The catch block for issue count fetching references the repoData
state variable, but inside the useEffect callback this is a stale
closure value (null on first render). The fallback never triggers
because repoData is always null at that point.

Use the local repoRes.data variable which is already available in
the same scope and contains the freshly fetched data.
@hconsulting987654321-blip
Copy link
Copy Markdown
Author

Hi! This PR is ready for review — 37/37 tests pass. Happy to address any feedback or make adjustments. Thanks!

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.

1 participant