Skip to content

fix(chat): stop refetching unavailable text diffs - #941

Open
rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/chat-cache-empty-file-diffs
Open

rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/chat-cache-empty-file-diffs

Conversation

@rudycelekli

Copy link
Copy Markdown

What changed

The chat changes panel fetched a file again whenever its server response had no text diff. The result was cached as null, then the load effect treated null as a cache miss. This could repeat for binary or oversized files for as long as the detail panel stayed open. The panel now distinguishes a completed empty result from an unfetched file.

Scope

  • Platform chat workspace UI

Validation

  • The new regression against main observed two requests after returning an empty diff. The patch leaves the existing unavailable-text message visible after exactly one request.
  • All 16 changes panel and diff helper tests passed.
  • git diff --check passed. git merge-tree also combined this change with fix(chat): scope workspace changes to their run #938. Full public browser and platform suites were not run.

Safety

  • I did not include credentials, internal endpoints, production data, or organization-specific infrastructure.
  • I preserved user files and unrelated changes.

@Yanami-2K Yanami-2K left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

核对了 chatbot/src/ChangesPanel.jsx:用 Object.hasOwn(patches, path) 区分“已经拉取过但结果是 null”和“还没拉取”,并把 effect 依赖从整个 patches 收窄到 cached,这样二进制或超大文件不会反复重新请求。新测试第一次返回 null、之后返回永不完成的 Promise,并断言只调用了一次且显示了无文本改动的提示,确实能捕捉到原来的重复请求。它和 #938 的改动互补,作者也已用 merge-tree 确认两者可以干净合并。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants