Skip to content

Commit 22e96ea

Browse files
committed
fix: "failed to fetch" on updating node software
1 parent 5041cd4 commit 22e96ea

File tree

10 files changed

+33
-21
lines changed

10 files changed

+33
-21
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches: [main]
55

66
env:
7-
VERSION: "3.5.2"
7+
VERSION: "3.5.3"
88

99
jobs:
1010
webui:

webui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "func-webui",
3-
"version": "3.5.2",
3+
"version": "3.5.3",
44
"scripts": {
55
"dev": "vite",
66
"build": "vite build",

webui/src/components/AppBar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const account = ref<modelsv2.Account>();
167167
const showSettings = ref(false);
168168
169169
onBeforeMount(() => {
170-
store.refresh++;
170+
store.refreshPart++;
171171
});
172172
async function walletAction(wallet: Wallet) {
173173
try {
@@ -176,7 +176,7 @@ async function walletAction(wallet: Wallet) {
176176
: wallet.isConnected
177177
? wallet.setActive()
178178
: await wallet.connect();
179-
store.refresh++;
179+
store.refreshPart++;
180180
store.connectMenu = false;
181181
} catch (err: any) {
182182
console.error(err);
@@ -194,7 +194,7 @@ const items = computed(() => {
194194
195195
async function switchAccount(wallet: Wallet, acct: WalletAccount) {
196196
wallet.setActiveAccount(acct.address);
197-
store.refresh++;
197+
store.refreshPart++;
198198
store.connectMenu = false;
199199
}
200200
@@ -205,7 +205,7 @@ function copyToClipboard() {
205205
}
206206
207207
watch(
208-
() => store.refresh,
208+
() => store.refreshPart,
209209
async () => {
210210
if (activeAccount.value) {
211211
account.value = await algodClient.value

webui/src/components/Manage.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@
9393
:token="nodeStatus.token"
9494
@close="
9595
showConfig = false;
96-
emit('getStatus');
96+
store.refreshStatus++;
9797
"
9898
/>
9999
<DataDir
100100
:visible="showDataDir"
101101
:name="name"
102102
@close="
103103
showDataDir = false;
104-
emit('getStatus');
104+
store.refreshStatus++;
105105
"
106106
/>
107107
<Reti
@@ -126,7 +126,6 @@ const props = defineProps({
126126
nodeStatus: { type: Object as PropType<NodeStatus>, required: true },
127127
status: { type: String, required: true },
128128
});
129-
const emit = defineEmits(["getStatus"]);
130129
const loading = ref(false);
131130
const showReti = ref(false);
132131
const showConfig = ref(false);
@@ -230,7 +229,7 @@ async function toggleTelemetry() {
230229
}
231230
232231
async function finish(message: string) {
233-
emit("getStatus");
232+
store.refreshStatus++;
234233
loading.value = false;
235234
store.setSnackbar(message, "success");
236235
}

webui/src/components/Node.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
:name="name"
6969
:node-status="nodeStatus"
7070
:status="status"
71-
@get-status="getAllStatus()"
7271
/>
7372
</v-col>
7473
<template v-if="nodeStatus.serviceStatus === 'Running'">
@@ -349,6 +348,11 @@ async function autoRefresh() {
349348
}
350349
}
351350
351+
watch(
352+
() => store.refreshStatus,
353+
async () => await getAllStatus()
354+
);
355+
352356
async function getAllStatus() {
353357
await getNodeStatus();
354358
await getAlgodStatus();
@@ -392,6 +396,7 @@ async function getNodeStatus() {
392396
}
393397
394398
let restartAttempted = false;
399+
let retry = false;
395400
396401
async function getAlgodStatus() {
397402
try {
@@ -400,6 +405,7 @@ async function getAlgodStatus() {
400405
} else {
401406
algodStatus.value = undefined;
402407
}
408+
retry = false;
403409
if (nodeStatus.value?.retiStatus?.version && !retiLatest.value) {
404410
const releases = await axios({
405411
url: "https://api.github.com/repos/algorandfoundation/reti/releases/latest",
@@ -422,6 +428,11 @@ async function getAlgodStatus() {
422428
autoRefresh();
423429
}
424430
} catch (err: any) {
431+
if (!retry) {
432+
retry = true;
433+
await getAllStatus();
434+
return;
435+
}
425436
console.error(err);
426437
if (err.status !== 502 && !store.downloading)
427438
store.setSnackbar(err?.response?.data || err.message, "error");
@@ -496,7 +507,7 @@ watch(
496507
function reloadPartDetails() {
497508
if (!partDetails.value) return;
498509
partDetails.value = undefined;
499-
store.refresh++;
510+
store.refreshPart++;
500511
showReset.value = false;
501512
}
502513

webui/src/components/NodeTabs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ const tab = computed(() => {
4141
async function setNetwork(val: any) {
4242
const nid = networks.find((n) => n.title === val)?.id as NetworkId;
4343
await setActiveNetwork(nid);
44-
store.refresh++;
44+
store.refreshPart++;
4545
}
4646
</script>

webui/src/components/Participation.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ async function getKeys(): Promise<Participation[]> {
322322
.sort((a, b) => Number(b.key.voteLastValid) - Number(a.key.voteLastValid));
323323
}
324324
325-
async function refreshData() {
325+
async function refreshPartData() {
326326
try {
327327
const tempKeys = await getKeys();
328328
@@ -366,7 +366,7 @@ async function refreshData() {
366366
}
367367
368368
onMounted(() => {
369-
refreshData();
369+
refreshPartData();
370370
calcAvgBlockTime();
371371
});
372372
@@ -440,7 +440,7 @@ If the key was previously registered, you should wait 320 rounds after unregiste
440440
)
441441
) {
442442
await partClient.delete(id);
443-
await refreshData();
443+
await refreshPartData();
444444
}
445445
}
446446
@@ -481,7 +481,7 @@ async function generateKey() {
481481
generating = false;
482482
}
483483
store.setSnackbar("New key generated", "success");
484-
await refreshData();
484+
await refreshPartData();
485485
});
486486
} catch (err: any) {
487487
console.error(err);
@@ -571,8 +571,8 @@ function resetAll() {
571571
}
572572
573573
watch(
574-
() => store.refresh,
575-
async () => await refreshData()
574+
() => store.refreshPart,
575+
async () => await refreshPartData()
576576
);
577577
578578
function copyVal(val: string | number | bigint | undefined) {

webui/src/components/Settings.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ async function updateNode(release: string) {
167167
store.downloading = true;
168168
await FUNC.api.post("goal/update", { name: release });
169169
await getVersion();
170+
store.refreshStatus++;
170171
} catch (err: any) {
171172
console.error(err);
172173
store.setSnackbar(err?.response?.data || err.message, "error");

webui/src/stores/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export const useAppStore = defineStore("app", {
1212
timeout: 0,
1313
display: false,
1414
} as SnackBar,
15-
refresh: 0,
15+
refreshPart: 0,
16+
refreshStatus: 0,
1617
connectMenu: false,
1718
funcUpdateAvailable: false,
1819
nodeUpdateAvailable: false,

webui/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function execAtc(
2626
store.setSnackbar("Processing...", "info", -1);
2727
await atc.execute(algodClient, 4);
2828
store.setSnackbar(success, "success");
29-
store.refresh++;
29+
store.refreshPart++;
3030
}
3131

3232
async function getCatchpoint(name: string): Promise<string | undefined> {

0 commit comments

Comments
 (0)