forgejo-cli issues list serves a stale mappy cache; use_cache=False is dropped, and create_issue duplicate-checks against that same stale list #17
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#17
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?
Summary
forgejo-cli issues listserves a stale mappy-cached snapshot and silently omits issues createdsince the cache entry was written.
use_cache=Falseis accepted bysearch_issues_with_rerankingand then dropped on the floor before the actual HTTP request.The same defect makes
create_issue's duplicate-title check read a snapshot that predates theissues it is meant to be guarding against.
Where
src/forgejo_client/cli.py:176get_issueshas no cache parameter at all and calls_make_request(..., params=params)with thedefault
use_cache=True(src/forgejo_client/modules/issues.py:16-33).Reproduction
Same request, same moment, differing only in the cache flag:
Reproduced on
kade/rimmediately after creating issue #6.get_issue(6)reportsstate: openand the body, label and title are all correct — only the list is stale. There is no pagination
involvement:
?state=open,?state=open&limit=30and?state=open&limit=50all return 6.The cache key is
(method, endpoint, str(params)), so the stale entry is per-parameter-set andpersists until the mappy TTL expires.
Why it matters beyond the listing
create_issueopens with a duplicate-title guard (modules/issues.py:51):That call is cached too. The duplicate check cannot see issues created within the cache TTL, so
it does not prevent the thing it exists to prevent — it only prevents duplicates of issues older
than the cache entry. The safety check is reading a snapshot from before the thing it is checking.
A second consumer at
client.py:209and four more inmodules/issues.py(
:298,:392,:434,:482) andsearch/search_processor.py:196inherit the same behaviour.Suggested fix
get_issuesause_cache: bool = Trueparameter and forwardit to
_make_request. Then passuse_cachefromsearch_issues_with_rerankinginstead ofdropping it.
create_issue's duplicate check must not be cached. It is a correctness guard, not aread-through cache candidate — the request it makes is precisely the one where staleness causes
the bug. It should be
use_cache=Falseunconditionally.--no-cacheonissues list. Even with (1), a cached list is a footgun foranyone verifying that an action just took effect — which is the exact moment the cache is least
helpful.
Notes
kade/r#6. The immediate symptom — "I created an issue and the list does notshow it" — reads exactly like the contribution gate auto-closing a new issue, which sent the
investigation down the wrong path for a few minutes.
_make_requestalready treatsGETas the only cacheable method, so scoping the fix toget_issuesis sufficient; no other method is affected.