Skip to content

fix: preserve empty arrays in facet fields#114

Merged
aspiers merged 1 commit into
developfrom
empty-facet-arrays
Jan 26, 2026
Merged

fix: preserve empty arrays in facet fields#114
aspiers merged 1 commit into
developfrom
empty-facet-arrays

Conversation

@aspiers
Copy link
Copy Markdown
Contributor

@aspiers aspiers commented Jan 25, 2026

Change truthy checks to explicit !== undefined checks for shortDescriptionFacets and descriptionFacets to ensure empty arrays are preserved as valid values.

Fixes unresolved comment from PR #112 review thread #3700691486

Summary by CodeRabbit

  • Bug Fixes
    • Fixed handling of description fields during record creation so explicitly provided falsy or null values for short description and description are now preserved instead of being ignored.

✏️ Tip: You can customize this high-level summary in your review settings.


Note

Ensures facet fields are written even when empty arrays are provided.

  • In HypercertOperationsImpl.ts createHypercertRecord, changed checks to params.* !== undefined for shortDescriptionFacets and descriptionFacets, allowing empty arrays to be persisted instead of being skipped.

Written by Cursor Bugbot for commit e97a283. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings January 25, 2026 03:17
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 25, 2026

⚠️ No Changeset found

Latest commit: e97a283

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 25, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Changed two truthiness guards in createHypercertRecord to explicit !== undefined checks so provided but falsy values (e.g., null, "") for shortDescriptionFacets and descriptionFacets are still assigned.

Changes

Cohort / File(s) Summary
Guard condition refinement
packages/sdk-core/src/repository/HypercertOperationsImpl.ts
Replaced truthy checks on params.shortDescriptionFacets and params.descriptionFacets with explicit !== undefined comparisons to preserve assignment of provided falsy values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I hopped through code with careful paws,
Found a check that gave me pause.
Now undefined and false are split,
Properly assigned — a tidy fit.
Hooray for clarity! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: preserve empty arrays in facet fields' accurately summarizes the main change: replacing truthy checks with explicit undefined comparisons to preserve empty arrays as valid values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates hypercert record creation to preserve empty facet arrays by switching from truthy checks to explicit !== undefined checks.

Changes:

  • Preserve shortDescriptionFacets when provided as an empty array by checking !== undefined.
  • Preserve descriptionFacets when provided as an empty array by checking !== undefined.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Change truthy checks to explicit !== undefined checks for
shortDescriptionFacets and descriptionFacets to ensure empty
arrays are preserved as valid values.

Fixes unresolved comment from PR #112 review thread #3700691486
@aspiers aspiers force-pushed the empty-facet-arrays branch from 36eacc3 to e97a283 Compare January 26, 2026 06:41
@aspiers aspiers enabled auto-merge January 26, 2026 06:41
@aspiers aspiers merged commit b2e8cfd into develop Jan 26, 2026
4 of 5 checks passed
@aspiers aspiers deleted the empty-facet-arrays branch January 26, 2026 07:41
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