Skip to content

docs(wasm-sdk): clarify aggregate groupBy behavior - #4576

Open
thephez wants to merge 2 commits into
v4.2-devfrom
fix/wasm-sdk-aggregate-groupby-jsdoc
Open

docs(wasm-sdk): clarify aggregate groupBy behavior#4576
thephez wants to merge 2 commits into
v4.2-devfrom
fix/wasm-sdk-aggregate-groupby-jsdoc

Conversation

@thephez

@thephez thephez commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

The DocumentsQuery.groupBy declaration described the option exclusively as a count-query setting, despite the type also being shared by document sum and average queries. This caused generated declaration-based documentation to show count-specific wording for those methods.

What was done?

  • Updated the DocumentsQuery.groupBy JSDoc in packages/wasm-sdk/src/queries/document.rs to describe all aggregate queries.
  • Documented the ungrouped return values for getDocumentsCount, getDocumentsSum, and getDocumentsAverage.
  • Corrected related internal comments that described groupBy as count-only.

How Has This Been Tested?

No build or automated tests were run because this change only updates documentation comments.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Documentation
    • Clarified groupBy documentation for count, sum, and average aggregate results.
    • Documented the result shapes for ungrouped aggregate queries.
    • Updated terminology to consistently describe aggregate queries.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: c1d30b4c-c542-45b9-a00e-12dfef442df9

📥 Commits

Reviewing files that changed from the base of the PR and between 12914ce and 23dbc7c.

📒 Files selected for processing (1)
  • packages/wasm-sdk/src/queries/document.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Updated groupBy documentation and related Rust comments to describe count, sum, and average aggregate results. No executable behavior changed.

Changes

Aggregate query documentation

Layer / File(s) Summary
Align aggregate query documentation
packages/wasm-sdk/src/queries/document.rs
The groupBy documentation now covers ungrouped count, sum, and average results. Rust comments use aggregate-query terminology and identify group_by as an aggregate-query option.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 23dbc

This change clarifies WASM SDK aggregate-query documentation for count, sum, and average results without changing runtime behavior. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the documentation update for aggregate groupBy behavior in the WASM SDK.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wasm-sdk-aggregate-groupby-jsdoc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 9 ahead in queue (commit 23dbc7c)
Queue position: 10/32 · 2 reviews active
ETA: start ~23:43 UTC · complete ~00:45 UTC (median 1h 2m across 30 recent reviews; 2 slots)
Queued 5h 53m ago · Last checked: 2026-09-07 19:30 UTC

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Final validation — GLM Flash + Sol

The public groupBy JSDoc accurately documents count, sum, and average behavior, including each ungrouped result shape. One adjacent internal comment remains count-specific even though it describes ordering shared by all three aggregate surfaces.

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-5.6-sol (agent: phase2-reviewer, role: general); final verifier: gpt-5.6-sol (agent: sol-verifier, role: final-verifier)

Review provenance

  • Phase 1 reviewers (GLM Flash): glm-5.3-flash — general (completed); agent phase1-reviewer
  • Fresh verifier (Sol): gpt-5.6-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers (Sol): gpt-5.6-sol — general (completed); agent phase2-reviewer

💬 1 nitpick(s)

1 additional finding(s) omitted (not in diff).

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/wasm-sdk/src/queries/document.rs`:
- [NITPICK] packages/wasm-sdk/src/queries/document.rs:221-224: Shared ordering comment still refers only to count results
  This shared input comment still calls the ordered entries "count results," despite the PR's stated goal of replacing count-only terminology for options shared by count, sum, and average queries. The sum and average dispatchers also derive their ordering direction from the first `orderBy` clause and propagate it to split-result ordering and proof walk order, so the comment should describe aggregate query results rather than count results.

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.91%. Comparing base (a3c36f3) to head (23dbc7c).

Additional details and impacted files
@@             Coverage Diff              @@
##           v4.2-dev    #4576      +/-   ##
============================================
- Coverage     86.25%   85.91%   -0.34%     
============================================
  Files          2786     2786              
  Lines        365064   366759    +1695     
============================================
+ Hits         314869   315110     +241     
- Misses        50195    51649    +1454     
Components Coverage Δ
dpp 86.79% <ø> (-0.41%) ⬇️
drive 84.17% <ø> (-0.13%) ⬇️
drive-abci 89.69% <ø> (-0.13%) ⬇️
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.92% <ø> (ø)
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 42.03% <ø> (-7.19%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants