a2ui-project / a2ui-project/a2ui

[FEATURE]: Inject clocks into Dart/Flutter GenUI timestamps and timeouts

Abierto
#2,239 1 comentario 0 reacciones 1 asignado Reclamado por @Varun-S10 Ver en GitHub
P2 type: feature/enhancement
Lenguaje dominante
TypeScript
Estrellas
16.4k
Forks
1.3k
Merge medio
2 d 13 h
PR fusionados (30 d)
134

Descripción

- [x] I have searched the existing issues to make sure this feature has not already been requested.

## Is your feature request related to a problem? Please describe.

Deterministic tests cannot control all time sources in the Dart/Flutter GenUI path. Action timestamps, pending-update expiry, and widget/function timeouts can observe wall time or real timers even when the surrounding test uses Flutter's fake clock. Identical protocol input can therefore produce timing-dependent output, and timeout tests require real waits.

## Describe the Proposed Solution

Introduce public injectable clock/timer abstractions at the ownership points that create action timestamps or schedule GenUI-owned timeouts. Production defaults should retain current behavior; tests should be able to supply a monotonic fake clock and advance it without sleeping. Cover action timestamps, SurfaceController pending-update expiry, and GenUI-owned widget/client-function timeouts.

Acceptance evidence should prove identical messages and actions produce identical timestamps and timeout outcomes under an injected clock.

## Describe Alternatives Considered

Flutter WidgetTester.pump does not control every Dart/core time source. Normalizing timestamps afterward hides ordering bugs and cannot control timer behavior. Private-field patching is brittle.

## Additional Context

This concerns runtime-generated time, not A2UI protocol timestamps, and should remain independent of any one testing framework.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.