fix: correct loop variable in curl cleanup (streak fix)#889
Open
E-Kerem wants to merge 1 commit intoDenverCoder1:mainfrom
Open
fix: correct loop variable in curl cleanup (streak fix)#889E-Kerem wants to merge 1 commit intoDenverCoder1:mainfrom
E-Kerem wants to merge 1 commit intoDenverCoder1:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a cURL multi-handle cleanup bug in src/stats.php where the cleanup loop removed a stale $handle reference instead of the actual per-request handle, preventing proper handle removal when fetching multiple years in parallel.
Changes:
- Corrected the cleanup loop to remove each handle in
$requestsfrom the multi handle using the loop variable ($request) rather than a stale$handle.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug in
src/stats.phpwhere the parallel contribution fetching loop used an incorrect variable in its cleanup phase.Logic Bug
The cleanup loop declared
$requestbut used$handle(a stale reference from the previous loop). This caused a resource leak by only removing the last handle and leaving others unreleased.Impact on Streak Calculation
Leaking curl handles in a multi-batch environment can cause silent data-fetching failures. This leads to streaks appearing truncated or starting only from a recent year (like 2026) because data from previous years (like 2025) fails to load correctly into the stats array.
Fixes #886
Verified locally with user
E-Keremto ensure multi-year data is correctly merged and streaks are accurate.