Skip to content

Update bmrks extension#25952

Open
almoce wants to merge 2 commits intoraycast:mainfrom
almoce:ext/bmrks
Open

Update bmrks extension#25952
almoce wants to merge 2 commits intoraycast:mainfrom
almoce:ext/bmrks

Conversation

@almoce
Copy link
Contributor

@almoce almoce commented Mar 1, 2026

Summary

This PR improves reliability and UX in the bmrks extension by fixing auth error handling and preventing
duplicate bookmark submissions.

Changes

  • Updated auth error handling in src/components/authenticated-view.tsx:
    • Switched from string matching on error.message to checking error.code === "invalid_credentials".
    • Keeps error messaging consistent and less brittle.
  • Added submission guard in src/create-bookmark.tsx:
    • Introduced isSubmitting state.
    • Prevents duplicate submit actions while a request is in progress.
    • Wraps submission flow in try/finally to always reset loading state.
    • Shows form loading state when either groups are loading or submit is in progress (isLoadingGroups ||
      isSubmitting).

Why

  • Prevent accidental duplicate bookmark creation from repeated submit actions.
  • Improve auth error consistency by relying on structured error codes instead of message text. Resolves [(Basic) Bookmarks] ... #25909

- fix: lint fix
- fix: fix auth erro consistency
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: bmrks Issues related to the bmrks extension platform: macOS OP is contributor The OP of the PR is a contributor of the extension labels Mar 1, 2026
@raycastbot
Copy link
Collaborator

raycastbot commented Mar 1, 2026

Thank you for your contribution! 🎉

🔔 @raunofreiberg @peduarte @xmok 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.

📋 Quick checkout commands
BRANCH="ext/bmrks"
FORK_URL="https://github.com/almoce/raycast-extensions.git"
EXTENSION_NAME="bmrks"
REPO_NAME="raycast-extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@almoce almoce marked this pull request as ready for review March 1, 2026 22:29
@almoce almoce requested a review from peduarte as a code owner March 1, 2026 22:29
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR improves the bmrks extension by making auth error handling more robust and preventing duplicate bookmark submissions. The changes switch from brittle string matching to structured error code checking for authentication errors, and add proper state management to prevent race conditions during form submission.

Key improvements:

  • Replaced string matching (error.message.includes) with error code checking (error.code === "invalid_credentials") for more reliable auth error detection
  • Added isSubmitting state guard to prevent duplicate bookmark creation from rapid form submissions
  • Implemented try/finally pattern ensuring loading state is always reset, even when errors occur

Missing requirement:

  • CHANGELOG.md was not updated with this PR's changes, which violates the repository's changelog requirement for all pull requests

Confidence Score: 4/5

  • Safe to merge after adding changelog entry - code changes are sound and improve reliability
  • The implementation is solid with proper error handling and state management. Score reduced by 1 point due to missing CHANGELOG.md update, which is required by repository guidelines. The actual code changes are well-tested and improve the extension's reliability.
  • No files require special attention - the CHANGELOG.md update is the only outstanding requirement

Important Files Changed

Filename Overview
extensions/bmrks/src/components/authenticated-view.tsx Improved auth error handling by switching from string matching to error code checking
extensions/bmrks/src/create-bookmark.tsx Added submission guard to prevent duplicate bookmark creation with proper cleanup

Last reviewed commit: 3f5f9a8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: bmrks Issues related to the bmrks 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 platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[(Basic) Bookmarks] ...

2 participants