feat(contrail): RSVP support for Contrail-only ATProto events#575
Closed
tompscanlan wants to merge 8 commits into
Closed
feat(contrail): RSVP support for Contrail-only ATProto events#575tompscanlan wants to merge 8 commits into
tompscanlan wants to merge 8 commits into
Conversation
Support RSVP operations for Contrail-only ATProto events that have no tenant DB EventEntity row. These methods accept a raw AT URI instead of an EventEntity, use uri-only subject references (no CID lookup), and derive rkeys deterministically from the event URI.
When an event slug is not found in the tenant DB, check if it's an ATProto slug (did~rkey format). If so, validate against Contrail, verify user has ATProto identity, and publish RSVP directly to PDS via BlueskyRsvpService.createRsvpByUri(). - Add AtprotoEnrichmentService, ContrailQueryService, BlueskyRsvpService deps - Add attendContrailEvent() private method - Return API-compatible response shaped like normal attendee - 4 new tests covering happy path, missing event, no DID, non-ATProto slug
When cancelAttendingEvent receives a slug not found in the local DB, check if it parses as a Contrail ATProto slug (did~rkey format). If so, delete the RSVP directly from the user's PDS via BlueskyRsvpService.
Query Contrail's RSVP table by user DID when rendering the dashboard Attending tab, so events RSVPed to via PDS (Contrail-only) appear alongside tenant DB results. Deduplicates by atprotoUri and handles Contrail errors gracefully.
The integration test for EventManagementService was missing mock providers for AtprotoEnrichmentService, ContrailQueryService, and BlueskyRsvpService added in the Contrail RSVP feature.
Replace socialId + BlueskyService.resumeSession with PdsSessionService.getSessionForUser which properly resolves the user's ATProto identity from userAtprotoIdentities table and gets an authenticated PDS agent. This fixes RSVP for users whose DID is stored in the identity table rather than user.socialId.
Cancel attendance now publishes an RSVP update with status #notgoing via putRecord (idempotent overwrite) instead of deleting the record. This preserves the RSVP on the user's PDS. Also passes event CID from Contrail record into the StrongRef subject as required by the community.lexicon.calendar.rsvp lexicon.
…e tests The dashboard Attending tab used user.socialId to find the user's DID, but socialId is not reliable for users who linked ATProto after signup. Use UserAtprotoIdentityService.findByUserUlid() as the canonical DID source, falling back to socialId for backwards compatibility. Also fix missing tenantId in getUserById call. Add e2e test covering RSVP to Contrail-only events, cancel, error cases (404 for missing events, 400 for users without ATProto identity).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createRsvpByUri()anddeleteRsvpByUri()toBlueskyRsvpServicefor publishing RSVPs using raw AT URIs (noEventEntityrequired)attendEvent()andcancelAttendingEvent()to detect Contrail slugs (did:plc:xxx~rkey) and route to ATProto-native RSVP flow — publish/delete directly on user's PDSCloses om-76gq. Believed to be the last feature gap before Contrail changes can move to prod.
How it works
When a user RSVPs to a Contrail-only event (no tenant DB row):
did~rkey)contrailQueryService.findByUri()community.lexicon.calendar.rsvpTest plan