Skip to content

Decide whether Dispatch refuses names of standard DOM events #704

Done

Description

@JuroOravec

The question

Should actions.Dispatch(name=...) refuse event names that the browser and Vue already use, such as click, submit or input?

What happens today

Dispatch.__post_init__ (packages/py/citry/citry/ext/events/actions.py:295) checks that the name is a non-empty string that does not start with citry:. The browser runtime then fires new CustomEvent(name, {detail}) at the component's first element (packages/py/citry/citry/_vue/client.js:4226), and the event bubbles. A name such as click therefore runs every click listener on that element and its ancestors, including Vue @click handlers and Citry's own @c-* bindings, which can send another server call. No browser code checks event.isTrusted.

No code runs that the page did not already have, but when a handler takes the name from request data, the request decides which of the page's listeners run.

The trust-boundary doc for #603 rates name as app code and says to pick it from the app's own list.

Options

  1. Keep the rule and say on docs_site/content/events/actions.md that the name must come from the app's own code.
  2. Require a name with a : or - in it (custom event names), or refuse the names of standard DOM events.

🤖 Generated with Claude Code

Activity

  1. added
    next-sprint
    on Nov 15, 2026
  2. added this to the 1.1.0 milestone on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    next-sprint

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions