Skip to content

Events: support sending a call without waiting for earlier calls (wait: false) #155

Closed

Description

@JuroOravec

(Opus 5.5)

Citry 0.5.1 documented opts.wait: false on $sendEvent and Citry.events.send to send a call without waiting behind earlier calls from the same component. In 0.6.0 the Vue Events bridge sends the calls from one Vue app one at a time, and wait: false now rejects the call with a TypeError that says so and points at @event(latest_wins=True).

Why it is not supported yet:

  • Each server render is built on the app revision the browser held when it sent the call (X-Citry-Vue-Revision), and the browser applies a render only on exactly that revision (validateIsolatedEnvelope in citry/_vue/client.js). If two calls are in flight and one commits a render, the other one's render can no longer apply, even when it is the newer call.
  • Each call carries the State token the previous call returned. Two calls in flight both start from the same token, so the server state changes of one are lost when the other's State action lands.

What a real implementation would need: a way for the server to build a render the browser can apply after another render (or for the browser to resend), and a rule for merging or ordering State tokens. Until then the rejection is the safe behavior.

What is done: the option is rejected with a clear error, and unknown option keys are rejected by name (citry-events-vue.ts checkSendOptions).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions