feat(desktop): refresh publish tasks instantly on lease activation

Emit a 'publish-task-lease' runtime invalidation event whenever the
scheduler activates a publish task, and have PublishManagementView
listen for it to trigger an immediate refresh. The view also switches
to a 5s active-task poll only while a task is in_progress, replacing
the unconditional 20s timer.
This commit is contained in:
2026-05-06 21:34:13 +08:00
parent ddce8b3d8d
commit df467b63b4
5 changed files with 82 additions and 13 deletions
@@ -1,16 +1,17 @@
type RuntimeInvalidationReason = 'account-health'
type RuntimeInvalidationReason = 'account-health' | 'publish-task-lease'
type RuntimeInvalidationListener = (event: {
reason: RuntimeInvalidationReason
at: number
accountId?: string
taskId?: string
}) => void
const listeners = new Set<RuntimeInvalidationListener>()
export function emitRuntimeInvalidated(
reason: RuntimeInvalidationReason,
details: { accountId?: string } = {},
details: { accountId?: string; taskId?: string } = {},
): void {
const event = {
reason,