restapi: include inactiveShards in the homepage total count#2797
Merged
bobcallaway merged 1 commit intoApr 17, 2026
Merged
Conversation
Member
|
it looks like you combined #2796 and this fix - can you please separate them? |
Contributor
Author
|
Separated — updated this PR to only contain the homepage inactiveShards fix. The retry error handler change is in #2796 alone @bobcallaway |
The HTML homepage served at / displays the log's total entry count but only reads j.treeSize from the /api/v1/log/ response, ignoring j.inactiveShards. After a shard rotation the total entry count is the sum of the active tree plus every inactive shard, so the page under- reports by the size of all previous shards. Sum the inactiveShards tree sizes into the displayed count, guarding against a missing or non-array inactiveShards field with a defensive Array.isArray check and Number() coercion. Fixes sigstore#2281 Signed-off-by: Ali <alliasgher123@gmail.com>
2edebf1 to
968fe21
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2797 +/- ##
===========================================
- Coverage 66.46% 26.17% -40.29%
===========================================
Files 92 191 +99
Lines 9258 20122 +10864
===========================================
- Hits 6153 5267 -886
- Misses 2359 14027 +11668
- Partials 746 828 +82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bobcallaway
approved these changes
Apr 17, 2026
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.
Summary
The HTML homepage at
/readsj.treeSizefrom/api/v1/log/to display "Currently storing N items" but ignoresj.inactiveShards. After a shard rotation the total count is the sum of the active tree plus every inactive shard, so the page under-reports by the size of all previous shards.Sum the inactive shards'
treeSizevalues into the displayed count, defensively guarding against a missing or non-arrayinactiveShardsfield.Fixes #2281
Signed-off-by: Ali alliasgher123@gmail.com