Profile fixes#133
Conversation
- Add RichText utility (src/lib/rich-text.ts) with createFacetsFromText() and createFacetsFromTextSync() for auto-detecting mentions, URLs, hashtags - Add comprehensive tests for RichText utility (11 tests) - Export RichText utilities from main index - Enhance JSDoc for createCollection, updateCollection, createProject, updateProject with avatar/banner examples - Update spec file to mark Change 2 and Change 3 as complete
Without this patch, blob uploads always use the PDS endpoint (com.atproto.repo.uploadBlob) regardless of server type, and profile operations incorrectly route through non-existent com.sds.repo.* endpoints. This causes blob uploads to fail on SDS servers because the repository DID is never passed. This patch solves the problem by: 1. Using com.sds.repo.uploadBlob with the repo query parameter for SDS servers, and com.atproto.repo.uploadBlob for PDS servers 2. Removing incorrect SDS routing from profile operations — SDS servers override standard ATProto endpoints rather than exposing separate ones 3. Extracting a shared BlobOperations interface with dependency injection, eliminating duplicate blob upload code across HypercertOperationsImpl, ProfileOperationsImpl, and BlobOperationsImpl 4. Adding a ProfileOperationsImpl.create() method for creating new profiles without the read-modify-write pattern 5. Refactoring applyParamsToProfile with helper methods to reduce duplication Co-authored-by: Claude <noreply@anthropic.com>
- Document CreateLocationParams with examples for string, URL, Blob, and structured formats - Add documentation for LocationParams union type - Add JSDoc to resolveLocationValue explaining format handling - Add examples to createLocationRecord method Closes hypercerts-sdk-38n
- Add test for attachLocation with simple text string (beta.13+ format) - Add test for attachLocation with geo: URI string - Add test for createCollection with simple text location string - Verify strings get wrapped in URI ref format Closes hypercerts-sdk-d2e
- @hypercerts-org/sdk-core: 0.10.0-beta.8 - @hypercerts-org/sdk-react: 0.10.0-beta.9
🦋 Changeset detectedLatest commit: bcd0492 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 |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces comprehensive SDK enhancements including PDS auto-detection from OAuth sessions, a dual profile API supporting both Bluesky and Certified profiles, blob operations dependency injection, RichText facet utilities, URI validation, and handleResolver configuration. Also integrates Beads issue tracking and updates React SDK hooks accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ATProtoSDK
participant OAuth
participant Session
participant PDS as PDS (from Token)
Note over Client,PDS: PDS Auto-Detection Flow
Client->>OAuth: Initiate OAuth flow with handleResolver
OAuth->>Session: Create session after callback
Note over Session: tokenInfo.aud contains PDS URL
Client->>ATProtoSDK: callback(params)
ATProtoSDK->>Session: Extract aud from tokenInfo
ATProtoSDK->>ATProtoSDK: Cache PDS URL in sessionPdsMap[did]
Client->>ATProtoSDK: repository(session)
ATProtoSDK->>ATProtoSDK: Check sessionPdsMap cache
alt Cache Hit
ATProtoSDK->>ATProtoSDK: Use cached PDS URL
else Cache Miss
ATProtoSDK->>ATProtoSDK: resolveSessionPds(session)
ATProtoSDK->>Session: Extract aud from tokenInfo
ATProtoSDK->>ATProtoSDK: Cache new PDS URL
end
ATProtoSDK-->>Client: Return Repository with resolved PDS
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
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 by CodeRabbit
New Features
Breaking Changes
Documentation