Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

The refresh functionality on /bounties/payouts/ throws "too many values to unpack (expected 2)" when returning cached GitHub issues data.

Root Cause

BountyPayoutsView.github_issues_with_bounties() returns inconsistent types:

  • Fresh API fetch: return issues, total_count (tuple)
  • Cached data: return cached_issues (list)

Calling code expects tuple unpacking:

issues, api_total_count = self.github_issues_with_bounties("$5", "closed", page, per_page)

Changes

website/views/organization.py

  • Cache the complete tuple instead of just the issues list
  • Return tuple consistently in all code paths
# Before
cached_issues = cache.get(cache_key)
if cached_issues:
    return cached_issues
cache.set(cache_key, issues, 60 * 30)
return issues, total_count

# After  
cached_data = cache.get(cache_key)
if cached_data:
    return cached_data
result = (issues, total_count)
cache.set(cache_key, result, 60 * 30)
return result

website/tests/test_organization.py

  • Add tests verifying tuple return type for both fresh and cached calls
  • Add test verifying error cases return proper empty tuple
Original prompt

please fix this error when refreshing the bounties on this page https://owaspblt.org/bounties/payouts/ Error fetching issues from GitHub: too many values to unpack (expected 2)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 16, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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


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

@github-actions github-actions bot added the unresolved-conversations: 0 PR has 0 unresolved conversations label Nov 16, 2025
Copilot AI changed the title [WIP] Fix error when refreshing bounties on payout page Fix tuple unpacking error in BountyPayoutsView cache returns Nov 16, 2025
Copilot AI requested a review from DonnieBLT November 16, 2025 18:57
@DonnieBLT DonnieBLT marked this pull request as ready for review November 16, 2025 19:00
@github-actions github-actions bot added the files-changed: 2 PR changes 2 files label Nov 16, 2025
@DonnieBLT DonnieBLT merged commit 0d7887e into main Nov 16, 2025
16 checks passed
@DonnieBLT DonnieBLT deleted the copilot/fix-bounties-refresh-error branch November 16, 2025 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

files-changed: 2 PR changes 2 files unresolved-conversations: 0 PR has 0 unresolved conversations

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants