Skip to content

activity: skip legacy string contributors during hydration - #33

Merged
Kzoeps merged 3 commits into
mainfrom
activity/skip-legacy-contributors
Oct 7, 2026
Merged

Kzoeps merged 3 commits into
mainfrom
activity/skip-legacy-contributors

Conversation

@Kzoeps

@Kzoeps Kzoeps commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Skip legacy string entries in hydrated activity contributors, preserving the original record and relative order/multiplicity of surviving object entries.
  • Prevent these entries from crashing get/list/search activity responses and activity projections in collection items and entity following; cursor behavior is unchanged.
  • Update generated Lua bundles, projection contract/docs snapshots, and add a patch Changeset.

Validation

  • Independent review: no confirmed correctness findings.
  • Focused activity, collection, and entity-follow unit suites: 40 passed.
  • Generated Lua freshness, Lua lint (55 files), syntax for five changed bundles, docs sync, Changeset status, and diff checks passed.

Validation limitations

  • HTTP/PostgreSQL runtime tests were not run: Docker daemon unavailable. Pagination regressions use mocked database results.
  • Full unit run: 176 passed, 16 setup failures from missing dependencies.
  • Full pnpm check stopped at JS lint because workspace dependencies were absent and system ESLint 6 could not load the project configuration. No dependencies installed.

Summary by CodeRabbit

  • Bug Fixes

    • Activity responses now omit legacy string entries from hydrated contributor lists while preserving structured contributors, their order, and duplicates.
    • Original activity records remain unchanged, including legacy contributor entries. Hydrated contributor lists are omitted when the source field is absent and returned as empty arrays when it contains no structured entries.
  • Documentation

    • Clarified how contributor lists are represented in activity responses.

@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2382fb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hypercerts-org/hypercerts-api Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-endpoints Ready Ready Preview Oct 7, 2026 10:21am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26930feb-57ec-4c49-ae3b-7048735a4bed
📥 Commits

Reviewing files that changed from the base of the PR and between b73c4ce and 2382fb0.

📒 Files selected for processing (2)
  • api/tests/unit/tooling/activity.test.js
  • api/tests/unit/tooling/collection.test.js

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


📝 Walkthrough

Walkthrough

Activity hydration now skips legacy string entries in contributor projections. It preserves those entries in source records and continues to hydrate non-string contributors. Tests and API descriptions cover these projection rules.

Changes

Activity contributor projection

Layer / File(s) Summary
Contributor projection behavior
api/lua/endpoints/*.lua, api/lua/shared/activityProjection.lua, api/tests/unit/tooling/activity.test.js, api/tests/unit/tooling/collection.test.js, api/tests/unit/tooling/entity-follow.test.js, api/lexicons/org.hypercerts.claim.getActivity.json, docs/openapi.json, docs/sources/lexicons/org.hypercerts.claim.getActivity.json, .changeset/activity-contributor-legacy-strings.md
Hydration omits string entries from projected contributors while preserving them in source records. Tests cover mixed and all-legacy contributor arrays, actor resolution, and pagination. API descriptions document the projection rules.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 2382f

No actionable merge-blocking issue is identified. HTTP and PostgreSQL runtime behavior remains untested, but that limitation alone does not establish a defect.

🚥 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 7 functions across 9 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 main change: skipping legacy string contributors during activity hydration.
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 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@Kzoeps
Kzoeps merged commit 9a92a74 into main Oct 7, 2026
7 of 8 checks passed
@Kzoeps
Kzoeps deleted the activity/skip-legacy-contributors branch October 7, 2026 10:30
@github-actions github-actions Bot mentioned this pull request Oct 7, 2026

This branch was successfully deployed

1 active deployment
Preview — 2382fb03 Deployed Oct 7, 2026 by vercel[bot]
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.

1 participant