fix(kb): hide the storage usage bar for legacy (Classic) KBs - #1110
Merged
Merged
Conversation
Byte tracking is scoped to managed KBs (Req 12.11), so a legacy KB reports zeroed counters and cap=null. The usage bar therefore rendered '0 B stored' beside real documents on every Classic agent, which reads as a bug. Gate showUsageBar on the managed engine (kbUsage.engine === 'managed') instead of merely 'kbUsage is present'. Managed KBs are unaffected; legacy KBs show only per-document sizes. Adds a spec asserting the bar (and its progressbar element) is absent for a legacy KB in edit mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The KB storage usage bar shows "0 B stored" on every Classic (legacy S3-Vectors) agent, even when it has real documents. Byte tracking is scoped to managed KBs (Req 12.11): a legacy KB reports
cap=nulland zeroed counters, so the bar has nothing meaningful to show and reads as a bug to users.Reported in dev: a Classic agent with two 129 KB docs still showed "0 B stored".
Fix
Gate
showUsageBaron the managed engine rather than merely "kbUsage is present":The legacy label/level computeds are left intact (harmless, and keep the bar re-enable-able) — only visibility changes.
Tests
showUsageBar()isfalseand no[role=progressbar]renders for a legacy KB in edit mode.Frontend specs run under Angular/karma in CI (not locally runnable in this env, same as the usage-bar PR #1108) — relying on the
Test frontend+ coverage jobs.