Skip to content

fix(desktop): keep same-Host projection refreshes latest-wins #3477

Closed

Description

@M4n5ter
English

What happens

Default-Host-backed Skills, managed skill sources, bundled skill catalog, and scheduled tasks guard against a result from an old Host, but concurrent refreshes for the same Host have no latest-request ordering.

A reachable sequence is:

  1. Refresh A starts for the current default Host and remains pending.
  2. A later refresh B starts for the same Host, for example after a mutation or another refresh trigger.
  3. B returns and commits newer presentation data.
  4. A returns last, passes the Host-identity check, and overwrites B with its older result.

This behavior predates #3465 and does not block its cross-Host consistency fix. It was identified during review in #3465 (comment).

Scope

  • Skills
  • Managed skill sources
  • Bundled skill catalog
  • Scheduled tasks
  • Preserve the existing default-Host identity check

Project presentation is not in scope because it already owns a refresh generation. Diagnostics clipboard fallback behavior is unrelated and also out of scope.

Acceptance criteria

  • Each affected projection commits a result only if no newer refresh for that same projection has started.
  • A focused ordering test holds refresh A pending, lets refresh B commit, then settles A and verifies that B remains presented.
  • The solution remains local to refresh ordering; it does not add global state, cancellation, or another Host authority.

AI use

OpenAI Codex assisted with investigating the review finding and drafting this issue. The human contributor remains responsible for the scope and decision.

简体中文

问题表现

依赖默认 Host 的 Skills、managed skill source、bundled skill catalog 和 scheduled task 已能阻止旧 Host 的结果提交,但同一 Host 的并发刷新缺少 latest-request 排序。

可达时序如下:

  1. 当前默认 Host 上的刷新 A 启动后保持 pending。
  2. 同一 Host 上更晚的刷新 B 启动,例如由 mutation 后刷新或另一个刷新入口触发。
  3. B 先返回并提交较新的展示数据。
  4. A 最后返回,因为 Host identity 仍相同而通过校验,并用旧结果覆盖 B。

该问题早于 #3465 存在,不阻塞其跨 Host 一致性修复。问题来源于 #3465 (comment) 的 review。

范围

  • Skills
  • Managed skill source
  • Bundled skill catalog
  • Scheduled task
  • 保留现有默认 Host identity 校验

Project presentation 已经拥有 refresh generation,不在本 issue 范围内。诊断剪贴板 fallback 与本问题无关,同样不在范围内。

验收标准

  • 每个受影响的 projection 仅在其后没有启动更新刷新时提交结果。
  • 增加定向时序测试:刷新 A 保持 pending,刷新 B 先提交,随后 A 返回,最终仍展示 B。
  • 方案仅负责局部 refresh ordering,不增加全局状态、取消机制或新的 Host authority。

AI 使用

OpenAI Codex 协助调查 review finding 并起草本 issue;范围和决策仍由贡献者本人负责。

Activity

  1. self-assigned this
    on Aug 22, 2026
  2. added
    bug
    on Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions