Skip to content

Updated activitypub Bluesky sharing enablement flow#20

Open
tomerqodo wants to merge 6 commits intoaugment_combined_20260121_augment_sentry_coderabbit_1_base_updated_activitypub_bluesky_sharing_enablement_flow_pr244from
augment_combined_20260121_augment_sentry_coderabbit_1_head_updated_activitypub_bluesky_sharing_enablement_flow_pr244
Open

Updated activitypub Bluesky sharing enablement flow#20
tomerqodo wants to merge 6 commits intoaugment_combined_20260121_augment_sentry_coderabbit_1_base_updated_activitypub_bluesky_sharing_enablement_flow_pr244from
augment_combined_20260121_augment_sentry_coderabbit_1_head_updated_activitypub_bluesky_sharing_enablement_flow_pr244

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from qodo-benchmark#244

mike182uk and others added 6 commits January 21, 2026 15:51
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
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jan 21, 2026

🤖 Augment PR Summary

Summary: Updates the Bluesky sharing enablement flow to use the ActivityPub v2 endpoints and a two-step “enable → confirm handle” activation process.

Changes:

  • Bumped @tryghost/activitypub to 2.0.0 to reflect the breaking API/flow changes.
  • Switched Bluesky enable/disable API calls from v1 to v2 endpoints and introduced confirmBlueskyHandle() to retrieve the confirmed handle.
  • Extended the Account model to include blueskyHandleConfirmed and made blueskyHandle nullable.
  • Updated React Query mutations to update the account cache for enabled/disabled and added a new confirm-handle mutation.
  • Reworked the Preferences UI to show an “enabling…” state and poll for handle confirmation before treating sharing as fully enabled.
  • Adjusted API tests to validate the new v2 endpoints and confirm-handle behavior.

Technical Notes: The UI polls confirmation every 5s (up to 12 retries) and falls back to disabling if confirmation does not complete.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

} finally {
setLoading(false);
}
await enableBlueskyMutation.mutateAsync();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If enableBlueskyMutation.mutateAsync() rejects, loading stays true because there’s no finally/error path resetting it; that can leave the UI disabled until refresh. Consider ensuring setLoading(false) happens on failure as well.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

};

const confirmHandle = useCallback(() => {
confirmBlueskyHandleMutation.mutateAsync().then((handle) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mutateAsync().then(...) chain doesn’t handle rejections; on network/API errors it can become an unhandled promise rejection in the browser. Consider awaiting with try/catch or adding a .catch(...) so polling errors are handled gracefully.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎


toast.error('Something went wrong, please try again.');

await disableBlueskyMutation.mutateAsync();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If disableBlueskyMutation.mutateAsync() throws here, the interval callback will reject and setLoading(false) won’t run, potentially leaving the UI stuck in loading. Consider guarding this with error handling in the failure path.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

}

retryCountRef.current += 1;
confirmHandle();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because confirmHandle() triggers an async request but is called from a fixed setInterval, a slow request can overlap with the next tick and fire multiple concurrent confirmations. That can inflate retry counts and increase chances of 429/rate-limit errors.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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.

3 participants