[CORRUPTED] Synthetic Benchmark PR #25189 - Updated activitypub Bluesky sharing enablement flow#68
Conversation
ref TryGhost/ActivityPub#1377 We updated the backend implementation of the Bluesky sharing enablement process to include a confirmation step in which the client would prompt the backend to check what handle has been assigned to the Bluesky account generated by Bridgy Fed - This circumvents the need to for us to compute the handle manually and potentially getting it wrong if we compute it in a different way to Bridgy Fed
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
User description
Benchmark PR TryGhost#25189
Type: Corrupted (contains bugs)
Original PR Title: Updated activitypub Bluesky sharing enablement flow
Original PR Description: ref TryGhost/ActivityPub#1377
We updated the backend implementation of the Bluesky sharing enablement process to include a confirmation step in which the client would prompt the backend to check what handle has been assigned to the Bluesky account generated by Bridgy Fed - This circumvents the need to for us to compute the handle manually and potentially getting it wrong if we compute it in a different way to Bridgy Fed
Note
Switch Bluesky sharing to v2 enable/disable endpoints, add handle confirmation flow with polling, update UI/state, and bump package to 2.0.0.
v2(enable,disable) and addconfirm-handleendpoint.enableBluesky()to no longer return a handle; introduceconfirmBlueskyHandle()returning a confirmed handle or empty string.AccountwithblueskyHandleConfirmedand makeblueskyHandlenullable.apps/activitypub/src/hooks/use-activity-pub-queries.ts):useConfirmBlueskyHandleMutationForUserand cache updater for Bluesky details.{blueskyEnabled, blueskyHandleConfirmed, blueskyHandle}appropriately and invalidate follows.views/Preferences/components/BlueskySharing.tsx):src/api/activitypub.test.ts):v2endpoints; add tests for handle confirmation and null/invalid responses.@tryghost/activitypubversion to2.0.0.Written by Cursor Bugbot for commit c743df5. This will update automatically on new commits. Configure here.
Original PR URL: TryGhost#25189
PR Type
Enhancement
Description
Migrate Bluesky API endpoints from v1 to v2 with new confirmation flow
Split
enableBluesky()into separate enable and confirm-handle operationsAdd handle confirmation polling mechanism with retry logic
Update Account model with
blueskyHandleConfirmedflag and nullable handleImplement UI confirmation flow with loading states and success/error handling
Bump
@tryghost/activitypubpackage version to 2.0.0Diagram Walkthrough
File Walkthrough
activitypub.ts
Split Bluesky enable/disable/confirm into separate v2 API methodsapps/activitypub/src/api/activitypub.ts
enableBluesky()to use v2 endpoint and return void instead ofhandle string
disableBluesky()method using v2 endpointconfirmBlueskyHandle()method using v2 confirm-handleendpoint with GET request
Accountinterface to includeblueskyHandleConfirmedbooleanand make
blueskyHandlenullableuse-activity-pub-queries.ts
Add handle confirmation mutation and update cache logicapps/activitypub/src/hooks/use-activity-pub-queries.ts
BlueskyDetailstype to encapsulate bluesky state (enabled,handleConfirmed, handle)
updateAccountBlueskyCache()to accept full BlueskyDetailsobject instead of just handle
useEnableBlueskyMutationForUserto set enabled=true,handleConfirmed=false, handle=null on success
useDisableBlueskyMutationForUserto set all bluesky fields tofalse/null on success
useConfirmBlueskyHandleMutationForUserhook that updatescache with confirmed handle
BlueskySharing.tsx
Implement handle confirmation polling and conditional UI renderingapps/activitypub/src/views/Preferences/components/BlueskySharing.tsx
limit for handle confirmation
handleConfirmedstate anduseEffecthook to manage confirmationflow lifecycle
polling
confirmed
enable
activitypub.test.ts
Update tests for v2 endpoints and new confirm-handle flowapps/activitypub/src/api/activitypub.test.ts
enableBlueskytests to use v2 endpoint and expect nullresponse
disableBlueskytest suite with v2 endpoint validationconfirmBlueskyHandletest suite with handle validationscenarios
handle types
endpoint
package.json
Bump package version to 2.0.0apps/activitypub/package.json