fix: add $type for contributor identity and contribution details StrongRefs#119
Conversation
🦋 Changeset detectedLatest commit: 2354987 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
📝 WalkthroughWalkthroughThe PR adds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
Summary
Fixes lexicon validation errors when creating hypercerts with contributors by ensuring
contributorIdentityandcontributionDetailsStrongRefs include$type: "com.atproto.repo.strongRef".Root Cause
The lexicon defines
contributorIdentityandcontributionDetailsas union types wrapped in$Typed<>, which requires$typeas a discriminator for validation. Unlike therightsfield (which uses plainComAtprotoRepoStrongRef.Main), these fields require$typeto pass validation.Changes
Implementation
resolveContributorIdentity(): Now converts string DIDs tocontributorInformationrecords and returns StrongRefs with$typeresolveContributionDetails(): Added$type: "com.atproto.repo.strongRef"to all StrongRef returnsResolvedContributorIdentityandResolvedContributionDetailstypes to include$typein StrongRef objectsTests
contributorInformationrecord creation when string DIDs are provided$type: "com.atproto.repo.strongRef"in all StrongRefsTest Results
Impact
This ensures hypercert records with contributors pass lexicon validation and can be created successfully without validation errors.
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.