feat(repo): add Octokit request timeouts and retry UI
Before, every GitHub call awaited indefinitely with no AbortSignal, so a "lie-fi" connection (technically online, effectively dead) left FluxNote stuck on the skeleton loader and the freshness badge spinning forever. Inject an 8s AbortSignal.timeout via octokit.hook.before (20s override on the recursive tree fetch), classify failures in the userRepo store as auth vs network, and surface a "Couldn't reach GitHub" retry button when no cached content is available.
This commit is contained in:
@@ -73,6 +73,10 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
const retryLoad = () => {
|
||||
store.setUserRepo(props.user, props.repo)
|
||||
}
|
||||
|
||||
onMounted(() => visitRepo())
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -102,6 +106,13 @@ onUnmounted(() => {
|
||||
</div>
|
||||
<slot />
|
||||
<skeleton-loader v-if="isLoading" />
|
||||
<div
|
||||
v-else-if="withContent && !hasContent && store.loadError === 'network'"
|
||||
class="repo-network-error"
|
||||
>
|
||||
<p>Couldn't reach GitHub. Check your connection.</p>
|
||||
<button class="btn btn-primary" @click="retryLoad">Retry</button>
|
||||
</div>
|
||||
<div v-else-if="withContent && !hasContent" class="repo-not-found">
|
||||
<template v-if="isLogged">
|
||||
<p>This repository is not accessible.</p>
|
||||
@@ -198,7 +209,8 @@ $header-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.repo-not-found {
|
||||
.repo-not-found,
|
||||
.repo-network-error {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user