Skip to content

Evict script executions whose entity is gone for good #93

Description

@bburda

Summary

An execution belonging to an entity that disappears permanently is polled once a second forever, is shown as running, and never offers a way to remove it.

The UI keeps its own list of script executions, because the gateway has no endpoint that lists them, and one interval refreshes the ones that are still active. When a poll returns 404, the record is marked as no longer tracked and drops out of the loop - but only when the gateway says the execution is gone (resource-not-found). A 404 saying the entity is gone (entity-not-found) deliberately leaves the record alone, because under runtime discovery an entity vanishes briefly whenever its node restarts, and dropping a running script's id at that moment would orphan the process for good.

The consequence is the case where the entity never comes back: nothing ever clears the record.

It is bounded - background requests only, skipped while the browser tab is hidden, and gone on reload - so this is a rough edge rather than an outage.


Proposed solution (optional)

Give the record a way to give up that still tolerates a transient absence: a consecutive-failure count, or an age since the last successful poll, after which it stops being treated as active and offers Remove like any other finished execution. The threshold wants to be comfortably longer than a node restart.


Additional context (optional)

Introduced with the Scripts tab in #90. The narrowing to resource-not-found was itself a fix: before it, any 404 marked the record lost, so a node restart silently detached a running script from its card.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions