Skip to content

Update Bluesky extension - chore: update @atproto/api for better typing + in Notifications, fix initialRes.body?.cancel error#17561

Merged
raycastbot merged 11 commits intoraycast:mainfrom
xmok:ext/bluesky
Mar 6, 2025
Merged

Update Bluesky extension - chore: update @atproto/api for better typing + in Notifications, fix initialRes.body?.cancel error#17561
raycastbot merged 11 commits intoraycast:mainfrom
xmok:ext/bluesky

Conversation

@xmok
Copy link
Contributor

@xmok xmok commented Mar 5, 2025

Description

I've honestly been using this extension almost daily.

This error would crop up almost daily and despite also being mentioned in the above comment, I could not figure out where it was coming from as the error was thrown from inside the @atproto/api package. Best I can guess, it has something to do with an expired or expiring session which causes an error. To fix the error, I added a try...catch block which swallows the error. Showing a Toast is not helpful to users as the extension continues to work.


I'm really excited about the new typing because we previously had to do a lot of casting to unknown and more. We now have nice utility exposed by the updated package allowing us to check the type of items. This has allowed me to simplify code in a lot of places. The functions are well-documented in the above link.

I've tested these changes and all seems to work fine. I am also able to reply to posts easily.

Coming up next (maybe?):

  • show some feedback in the new post form e.g. when the form is empty no error is thrown, no loading indicator shown during, and so on.

Screencast

There is no change in functionality but here is a screencast nonetheless:

bsky-all-good.mp4

Checklist

@xmok xmok requested a review from peduarte as a code owner March 5, 2025 11:02
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: bluesky Issues related to the bluesky extension OP is contributor The OP of the PR is a contributor of the extension labels Mar 5, 2025
@raycastbot
Copy link
Collaborator

raycastbot commented Mar 5, 2025

Thank you for your contribution! 🎉

🔔 @dkapila @peduarte you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

Due to our current reduced availability, the initial review may take up to 10-15 business days

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR updates the Bluesky extension to handle session expiration errors in notifications and improves TypeScript typing through an @atproto/api package update.

  • Added try-catch block around getUnreadNotificationCount() in notifications.tsx to gracefully handle session expiration errors
  • Updated @atproto/api from v0.13.26 to v0.14.7 for better type safety using new type guards like isThreadViewPost and AppBskyEmbedImages.isView
  • In notifications.tsx, consider using showFailureToast from @raycast/utils instead of showDangerToast for error handling
  • Since there are view commands in package.json, ensure there is a metadata folder with screenshots per store guidelines
  • The changelog entry title should end with {PR_MERGE_DATE} template string

7 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

@pernielsentikaer pernielsentikaer self-assigned this Mar 6, 2025
Copy link
Collaborator

@pernielsentikaer pernielsentikaer left a comment

Choose a reason for hiding this comment

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

Hi 👋

Looks good to me, approved 🔥

@raycastbot raycastbot merged commit 9356fdd into raycast:main Mar 6, 2025
2 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2025

Published to the Raycast Store:
https://raycast.com/dharamkapila/bluesky

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@xmok xmok deleted the ext/bluesky branch March 7, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: bluesky Issues related to the bluesky extension extension fix / improvement Label for PRs with extension's fix improvements OP is contributor The OP of the PR is a contributor of the extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants