Update Bluesky extension - chore: update @atproto/api for better typing + in Notifications, fix initialRes.body?.cancel error#17561
Conversation
|
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 |
There was a problem hiding this comment.
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()innotifications.tsxto 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
isThreadViewPostandAppBskyEmbedImages.isView - In
notifications.tsx, consider usingshowFailureToastfrom@raycast/utilsinstead ofshowDangerToastfor error handling - Since there are view commands in
package.json, ensure there is ametadatafolder 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
left a comment
There was a problem hiding this comment.
Hi 👋
Looks good to me, approved 🔥
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
I've honestly been using this extension almost daily.
Notifications, fixinitialRes.body?.cancelerror (related: Issue #14814 comment)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
Toastis not helpful to users as the extension continues to work.@atproto/apiso we have better TS typing (ref: @atproto/api v0.14.0 release notes)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?):
Screencast
There is no change in functionality but here is a screencast nonetheless:
bsky-all-good.mp4
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool