a2ui-project / a2ui-project/a2ui

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

未关闭
#2,239 1 条评论 0 个 reaction 已指派 1 人 已被 @Varun-S10 认领 在 GitHub 查看
P2 type: feature/enhancement
主要语言
TypeScript
星标
16.4k
派生
1.3k
平均合并
2 天 13 小时
30 天内合并 PR
134

描述

- [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.

贡献指南

打开贡献指南

调研方向

Look for ownership points that create action timestamps or schedule GenUI-owned timeouts, such as SurfaceController pending-update expiry and widget/client-function timeouts. Start by examining the runtime-generated time sources in the Dart/Flutter GenUI path to understand where clock injection is needed. Verify that production defaults retain current behavior and that tests can supply a fake clock. Acceptance evidence should show identical messages and actions produce identical timestamps and timeout outcomes under an injected clock.

由索引模型根据 Issue 内容生成。

评估

技术栈
dart, flutter, typescript
领域
backend-api-design, testing-qa
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。