Skip to content

Coalesce the redundant GET /api/documents requests fired on load.…#401

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jun 30, 2026
Merged

Coalesce the redundant GET /api/documents requests fired on load.…#401
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

Coalesce the redundant GET /api/documents requests fired on load. Several consumers independently fetch the same full listing — the page-list context (asset/folder/file paths), the empty-editor state (entry count for the onboarding branch), and the wiki-link suggestion source (referenced assets) — so on boot and on every file-change push the server ran the same ready-gated disk walk two or three times concurrently. These now share a single in-flight request and one JSON parse. It is single-flight, not a result cache: the slot is released as soon as the request settles, so consumers that refetch on a file-change push still get current data. The sidebar file tree keeps its own depth=1 lazy fetch (a different URL) unchanged.

…(#2280)

PageListContext, EmptyEditorState, and the wiki-link suggestion source each
independently fetch the full /api/documents listing; on boot and every CC1
files push they ran the same ready-gated disk walk two or three times
concurrently. Route them through a shared single-flight coordinator so
overlapping calls coalesce into one request plus one parse.

Single-flight, not a cache: the slot releases on settle, so consumers that
refetch on a files push still get current data. FileTree's depth=1 lazy
fetch (a different URL) is unchanged.

GitOrigin-RevId: e6ac46966acca08cf896e3263d9b7bffdd2043d5

@inkeep-internal-ci inkeep-internal-ci Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28477098978). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.

@inkeep-oss-sync
inkeep-oss-sync Bot merged commit 9889e6f into main Jun 30, 2026
1 check passed
@inkeep-oss-sync
inkeep-oss-sync Bot deleted the copybara/sync branch June 30, 2026 21:31
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