Skip to content

fix(web): coalesce snapshot reloads on resync#1087

Merged
wbxl2000 merged 1 commit into
mainfrom
fix/web-snapshot-sync-loop
Jun 25, 2026
Merged

fix(web): coalesce snapshot reloads on resync#1087
wbxl2000 merged 1 commit into
mainfrom
fix/web-snapshot-sync-loop

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue.

Problem

The web UI could enter a session snapshot request storm when resync_required fired repeatedly. Each snapshot request was fast, but concurrent reloads queued up and made session switching or snapshot loading look slow.

What changed

  • Coalesce session snapshot reloads per session so repeated resync signals share one in-flight reload.
  • Queue at most one rerun while a reload is in flight, so the latest state is still refreshed after the current reload settles.
  • Add unit coverage for the coalescing runner.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Tests run:

  • pnpm --filter @moonshot-ai/kimi-web test
  • pnpm --filter @moonshot-ai/kimi-web typecheck

Avoid concurrent session snapshot requests when resync_required fires repeatedly, while still allowing one queued rerun after the in-flight reload settles.
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 92c806f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@92c806f
npx https://pkg.pr.new/@moonshot-ai/kimi-code@92c806f

commit: 92c806f

@wbxl2000 wbxl2000 merged commit 884b65a into main Jun 25, 2026
9 checks passed
@wbxl2000 wbxl2000 deleted the fix/web-snapshot-sync-loop branch June 25, 2026 03:49
@github-actions github-actions Bot mentioned this pull request Jun 25, 2026
wbxl2000 added a commit that referenced this pull request Jun 25, 2026
Resolve a conflict in apps/kimi-web/test/lib-logic.test.ts: keep main's
new createCoalescedAsyncRunner tests (from #1087) in place of the
removed KaTeX prose-dollar tests.
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.

1 participant