search_issues_cross_repo leaks repo context on a mid-loop exception #21
Labels
No labels
api
architecture
auth
authentication
blocked
bug
chore
ci/cd
codec-constraints
component:blitz
component:chatter
component:entertainment
component:foodchain
component:forgejo-client
component:gatekeeper
component:mappy
component:monads
component:spiffy
deduplication
dependencies
documentation
enhancement
feature
fix
graphics
in-progress
lang:go
lang:python
lang:rust
lang:shell
lang:toml
lang:typescript
performance
pkg:agent
pkg:ai
pkg:coding-agent
pkg:tui
priority:critical
priority:high
priority:low
priority:medium
ready
resolution
review
security
technical-debt
testing
tracking
vendor
video-encoding
workgroup
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
kade/forgejo-client#21
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
search_issues_cross_repotemporarily mutates shared client state(
config.repo_owner/config.repo_name) to search each repo, and restored itinside the
tryblock:An exception between the assignment and the restore leaves the last-visited repo
permanently installed on the client, so every subsequent call on that client
targets the wrong repository.
Fix (implemented in the working tree)
Restore in a
finally, and narrow the blanket catch to the exceptions that canactually occur (request failures + malformed repo reference):
Tests (tests/test_labels.py, new)
test_repo_context_survives_a_failing_repo-- assertsrepo_owner/repo_nameare unchanged after the first repo raises and the second succeeds. Fails on HEAD.