Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ data class BackendRepoResponse(
val htmlUrl: String,
val stargazersCount: Int,
val forksCount: Int,
val openIssuesCount: Int = 0,
val language: String? = null,
val topics: List<String> = emptyList(),
val releasesUrl: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"Manual rescan surfaces every GitHub-style app on device.",
"Tighter auth handling — transient 401s no longer trigger spurious sign-outs."
"Tighter auth handling — transient 401s no longer trigger spurious sign-outs.",
"Open-issues count now shown to everyone, including signed-out users — the count now comes from the backend."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"إعادة المسح اليدوي تُظهر كل تطبيقات GitHub الموجودة على الجهاز دون تفويت أيّ منها.",
"معالجة أكثر صرامة للمصادقة: استجابات 401 العابرة لم تعد تتسبّب في تسجيل خروج خاطئ."
"معالجة أكثر صرامة للمصادقة: استجابات 401 العابرة لم تعد تتسبّب في تسجيل خروج خاطئ.",
"عداد المشكلات المفتوحة يظهر الآن للجميع بمن فيهم غير المسجَّلين — يأتي من الخادم الخلفي دون أي تكلفة لحصص GitHub."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"ম্যানুয়াল রি-স্ক্যান এখন ডিভাইসে থাকা সব GitHub-ধাঁচের অ্যাপ তুলে আনে।",
"অথেনটিকেশন আরও সংযত: সাময়িক 401 আর ভুল করে সাইন-আউট ঘটায় না।"
"অথেনটিকেশন আরও সংযত: সাময়িক 401 আর ভুল করে সাইন-আউট ঘটায় না।",
"ওপেন ইস্যুর সংখ্যা এখন সবাইকে দেখানো হয়, এমনকি সাইন-ইন না করা ব্যবহারকারীদেরও — ব্যাকএন্ড থেকে আসে, GitHub কোটায় কোনো খরচ নেই।"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"El reescaneo manual muestra todas las apps tipo GitHub presentes en el dispositivo.",
"Mejor manejo de autenticación: los 401 transitorios ya no provocan cierres de sesión espurios."
"Mejor manejo de autenticación: los 401 transitorios ya no provocan cierres de sesión espurios.",
"El número de incidencias abiertas ahora se muestra a todos, incluidos los usuarios sin sesión — viene del backend, sin coste de cuota de GitHub."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"Le rescan manuel fait remonter toutes les apps de type GitHub présentes sur l’appareil.",
"Gestion d’authentification renforcée : les 401 transitoires ne déconnectent plus à tort."
"Gestion d’authentification renforcée : les 401 transitoires ne déconnectent plus à tort.",
"Le nombre d’issues ouvertes s’affiche désormais pour tout le monde, y compris les utilisateurs déconnectés — fourni par le backend, sans coût de quota GitHub."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"मैन्युअल रीस्कैन डिवाइस पर मौजूद हर GitHub-शैली के ऐप को सामने ले आता है।",
"ऑथ हैंडलिंग पहले से बेहतर: अस्थायी 401 अब ग़लती से साइन-आउट नहीं कराते।"
"ऑथ हैंडलिंग पहले से बेहतर: अस्थायी 401 अब ग़लती से साइन-आउट नहीं कराते।",
"खुले इश्यू की संख्या अब सभी को दिखाई देती है, यहाँ तक कि साइन-आउट उपयोगकर्ताओं को भी — बैकएंड से आती है, GitHub कोटे पर कोई असर नहीं।"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"La rilevazione manuale mostra tutte le app di tipo GitHub presenti sul dispositivo.",
"Gestione dell’autenticazione più solida: i 401 transitori non causano più disconnessioni indebite."
"Gestione dell’autenticazione più solida: i 401 transitori non causano più disconnessioni indebite.",
"Il conteggio delle issue aperte ora è visibile a tutti, anche agli utenti non autenticati — arriva dal backend, senza costi di quota GitHub."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"手動での再スキャンで、端末上の GitHub 系アプリをすべて検出するようになりました。",
"認証エラー処理を強化。一時的な 401 で誤ってサインアウトされなくなりました。"
"認証エラー処理を強化。一時的な 401 で誤ってサインアウトされなくなりました。",
"オープン Issue 数を未ログインユーザーを含む全員に表示。バックエンドから取得するため GitHub のクォータを消費しません。"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"수동 재스캔이 기기의 모든 GitHub 계열 앱을 빠짐없이 표시합니다.",
"인증 처리 강화: 일시적인 401로 인해 잘못 로그아웃되지 않습니다."
"인증 처리 강화: 일시적인 401로 인해 잘못 로그아웃되지 않습니다.",
"열린 이슈 수가 이제 로그아웃 사용자를 포함한 모두에게 표시됩니다 — 백엔드에서 제공되며 GitHub 할당량을 소비하지 않습니다."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"Ręczne ponowne skanowanie pokazuje wszystkie aplikacje z GitHuba obecne na urządzeniu.",
"Stabilniejsza obsługa autoryzacji — przejściowe 401 nie powodują już fałszywych wylogowań."
"Stabilniejsza obsługa autoryzacji — przejściowe 401 nie powodują już fałszywych wylogowań.",
"Liczba otwartych zgłoszeń jest teraz pokazywana wszystkim, także użytkownikom niezalogowanym — pochodzi z backendu, bez kosztów limitu GitHuba."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"Ручное пересканирование показывает все приложения GitHub-типа на устройстве.",
"Аккуратная обработка авторизации: единичные 401 больше не вызывают ложный выход из аккаунта."
"Аккуратная обработка авторизации: единичные 401 больше не вызывают ложный выход из аккаунта.",
"Количество открытых задач теперь видно всем, в том числе неавторизованным пользователям — берётся из бэкенда, без расхода квоты GitHub."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"Manuel yeniden tarama, cihazdaki tüm GitHub tipi uygulamaları görünür kılıyor.",
"Daha sağlam kimlik doğrulama: geçici 401 yanıtları artık yanlışlıkla oturumu kapatmıyor."
"Daha sağlam kimlik doğrulama: geçici 401 yanıtları artık yanlışlıkla oturumu kapatmıyor.",
"Açık konu sayısı artık oturum açmamış kullanıcılar dahil herkese gösteriliyor — backend'den geliyor, GitHub kotası harcamıyor."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"type": "IMPROVED",
"bullets": [
"手动重新扫描会列出设备上所有 GitHub 风格的应用,不再漏报。",
"更稳健的鉴权处理:偶发的 401 不会再让你被错误地踢出登录。"
"更稳健的鉴权处理:偶发的 401 不会再让你被错误地踢出登录。",
"未登录用户也能看到「Open Issues」数量了 — 数据来自后端,不消耗任何 GitHub 配额。"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class DetailsRepositoryImpl(
val cacheKey = "details:repo:$owner/$name"
cacheManager.put(cacheKey, result, REPO_DETAILS)
cacheManager.invalidate("details:repo_id:${result.id}")
cacheManager.invalidate("details:stats:$owner/$name")
cacheManager.invalidate("details:stats:v2:$owner/$name")
cacheManager.invalidate("details:latest_release:$owner/$name")
cacheManager.invalidate("details:releases:$owner/$name")
return result
Expand Down Expand Up @@ -517,16 +517,19 @@ class DetailsRepositoryImpl(
owner: String,
repo: String,
): RepoStats {
val cacheKey = "details:stats:$owner/$repo"
// v2 — backend now supplies openIssues; pre-PR entries had it pinned
// to 0 for anon users. Bumping the key forces re-fetch instead of
// serving stale zeros for the remainder of the 6h TTL after upgrade.
val cacheKey = "details:stats:v2:$owner/$repo"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

cacheManager.get<RepoStats>(cacheKey)?.let { cached ->
logger.debug("Cache hit for repo stats $owner/$repo")
return cached
}

// Try backend first — provides stars/forks/downloadCount.
// Backend doesn't have openIssues/license, so supplement with a
// best-effort GitHub call for those fields. If GitHub is blocked
// Try backend first — provides stars/forks/openIssues/downloadCount.
// Backend doesn't have license yet, so supplement with a best-effort
// GitHub call for that field when signed in. If GitHub is blocked
// (e.g. for users in China), we still show the backend data.
val backendResult = backendApiClient.getRepo(owner, repo)
backendResult.fold(
Expand All @@ -553,19 +556,22 @@ class DetailsRepositoryImpl(
null
}

// If the GitHub enrichment didn't land, reuse the stale
// cached openIssues/license from a previous successful
// resolve. Prevents a transient GitHub failure from
// clobbering real values with zeros/nulls.
val stale = if (githubInfo == null) cacheManager.getStale<RepoStats>(cacheKey) else null
// Preserve last-known license when GitHub enrichment didn't
// land — backend doesn't supply license yet, so a transient
// failure would otherwise clobber a real value with null.
val staleLicense = if (githubInfo == null) {
cacheManager.getStale<RepoStats>(cacheKey)?.license
} else {
null
}

val result = RepoStats(
stars = backendRepo.stargazersCount,
forks = backendRepo.forksCount,
openIssues = githubInfo?.openIssues ?: stale?.openIssues ?: 0,
openIssues = backendRepo.openIssuesCount,
license = githubInfo?.license?.spdxId
?: githubInfo?.license?.name
?: stale?.license,
?: staleLicense,
totalDownloads = backendRepo.downloadCount,
)
cacheManager.put(cacheKey, result, REPO_STATS)
Expand Down