fix(#2443): address asyncBtn review notes

- asyncBtn now returns fn().finally(...) so callers can await/chain it
- Move re-fetch calls inside try/catch in core.js and permissions.js so
  network errors from fetchAndRenderStalePerms / fetchAndRender* are
  caught instead of escaping as unhandled rejections
- clearStaleAgent returns the asyncBtn promise so the function is
  properly awaitable when a button is present
- Update asyncBtn doc comment to reflect the return-value contract
This commit is contained in:
iris 2026-07-20 19:59:45 +02:00
commit 1acc271108
3 changed files with 11 additions and 10 deletions

View file

@ -115,12 +115,11 @@ function renderStalePerms(root, ghosts) {
errP.hidden = false;
return;
}
await fetchAndRenderStalePerms();
} catch (err) {
errP.textContent = 'failed to clear perms for ' + name + ': ' + err;
errP.hidden = false;
return;
}
await fetchAndRenderStalePerms();
}));
li.append(btn);
ul.append(li);