Skip to content

fix(libsql): omit unknown overview size bytes - #569

Merged
cevheri merged 1 commit into
libredb:mainfrom
Akimbo92i:fix/libsql-overview-size-absence-568
Sep 5, 2026
Merged

fix(libsql): omit unknown overview size bytes#569
cevheri merged 1 commit into
libredb:mainfrom
Akimbo92i:fix/libsql-overview-size-absence-568

Conversation

@Akimbo92i

Copy link
Copy Markdown
Contributor

Summary

  • Fixes libSQL overview reporting so unknown database size keeps databaseSize as "N/A" and omits databaseSizeBytes instead of reporting 0.

Changes

  • Include databaseSizeBytes from libSQL overview only when page counters are readable.
  • Update the existing absence test to expect the optional byte field to be undefined.
  • Document the libSQL unavailable-size behavior in the provider monitoring table.

Testing

  • git diff --check
  • npm exec --yes --package bun@1.4.0 -- bun test tests/unit/db/libsql/introspect.test.ts — 26 pass, 0 fail
  • npm exec --yes --package bun@1.4.0 -- bun test tests/unit/db/libsql tests/integration/db/libsql-provider.test.ts — 134 pass, 0 fail
  • npm exec --yes --package bun@1.4.0 -- bun run format — checked 983 files, no fixes applied
  • npm exec --yes --package bun@1.4.0 -- bun run lint — exit code 0, existing warnings only
  • npm exec --yes --package bun@1.4.0 -- bun run typecheck — exit code 0
  • npm exec --yes --package bun@1.4.0 -- bun run test — blocked by environment: Helm is not installed, so Helm chart tests fail with Executable not found in $PATH: "helm"; review evidence recorded 10108 pass, 355 fail, 6 errors before that tooling limitation stopped the full gate.

Related Issue

@Akimbo92i
Akimbo92i marked this pull request as ready for review September 5, 2026 11:26
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cevheri cevheri added bug Something isn't working documentation Improvements or additions to documentation labels Sep 5, 2026
@cevheri
cevheri merged commit f89b35b into libredb:main Sep 5, 2026
22 checks passed
@cevheri cevheri added good first issue Good for newcomers hacktoberfest-accepted Merged Hacktoberfest PR; counts for the participant labels Sep 5, 2026
@cevheri

cevheri commented Sep 5, 2026

Copy link
Copy Markdown
Member

Merged, thank you. Verified locally the way the issue asked: the flipped assertion fails against main's source with "Received: 0" and passes with your change, the libSQL unit and integration suites are green, and typecheck, format and lint pass. First contribution accepted for Hacktoberfest.

One note on your test run: the Helm chart tests need the helm binary, which CONTRIBUTING does not list yet. That gap is on us, not you.

cevheri pushed a commit that referenced this pull request Sep 6, 2026
getOverview() in both providers initialised databaseSizeBytes to 0 beside a
databaseSize of "0 bytes", ran the size statement inside a try whose catch was
empty, and returned the field unconditionally - so a statement that never
answered published a measured-looking zero. StorageTab.tsx keys its whole
breakdown off `databaseSizeBytes !== undefined`, so that fabricated 0 drew the
breakdown over a database it never measured, against per-table bytes from
getTableStats(), a separate read that does not share the failure.

The field is now spread only when the statement answered, mirroring the
activeConnections line two lines above it, and databaseSize moves with it -
"N/A" while the bytes are unknown, as in the merged libSQL (#569) and search
(#517) shapes, since both monitoring tabs render that string as the headline
size. A genuine reading of 0 stays 0: the `|| 0` fold inside the try is
deliberate, because an Oracle SUM over a schema that owns no segment is a
measured zero rather than an unknown, so only the catch path leaves the field
absent.

Both provider test files pin the absence and the measured zero, and
docs/providers/{mssql,oracle}.md gain a "7.3 When the database size is not
measurable" section beside 7.1 and 7.2.

Fixes #565

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest-accepted Merged Hacktoberfest PR; counts for the participant

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libSQL overview reports databaseSizeBytes as 0 when the page counters could not be read, while its own test says absent

2 participants