Skip to content

Need to consider how to cancel polling #4040

Description

@1cg

Four has no way to cancel hx-trigger="every ..." polling.

Current state:

2.x four
polling recursive setTimeout (processPolling) setInterval (src/htmx.js:830)
cancel state internalData.cancelled none
HTTP 286 yes no
public API none none

2.x honors a 286 response to stop polling, documented at https://htmx.org/docs/#polling
and inherited from intercooler's X-IC-CancelPolling. Four drops it silently.

Things to decide:

  • Should four honor 286?
  • Should there be a public htmx.cancelPolling(elt)?
  • Is cancellation permanent, or is there a resumePolling?

See #2576 for a 2.x proposal that added three mechanisms at once
(286, an HX-Cancel-Polling header, and htmx.config.cancelPollingOnError).
Corresponding 2.x issue: #2489

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

htmx 4Issues specific to htmx version 4

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions