Skip to content

[Brave] Fix missing history database crash - #30219

Merged
raycastbot merged 3 commits into
raycast:mainfrom
raulkolaric:fix/brave-missing-history
Aug 16, 2026
Merged

raycastbot merged 3 commits into
raycast:mainfrom
raulkolaric:fix/brave-missing-history

Conversation

@raulkolaric

Copy link
Copy Markdown
Contributor

Description

  • Prevent New Brave Tab from crashing when a Brave profile has not created a History database.
  • Skip unavailable profile databases while retaining history results from valid profiles.
  • Resolve profile metadata from the selected Brave Stable, Beta, or Nightly installation.
  • Replace stale cached profile selections when switching installations.

Root Cause

@raycast/utils validates the database path when useSQL is initialized, even when SQL execution is disabled. The Brave extension passed its expected History path unconditionally, causing a synchronous error whenever that file did not exist.

Profile discovery also always read Brave Stable's Local State file, which could produce profile IDs that did not exist in the selected Beta or Nightly installation.

User Impact

New Brave Tab remains usable when Brave is newly installed, a profile has no browsing history, or a cached profile is unavailable. Beta and Nightly profile discovery now uses the selected installation.

Validation

  • npm run lint
  • npm run build

Fixes #30131
Fixes #30153

Prevent New Brave Tab from crashing when the selected profile has not created a History database. Resolve profile metadata from the selected Brave channel so cached profiles remain aligned with database paths.

Changes:
- extensions/brave/src/hooks/useHistorySearch.tsx
  - Skip profiles whose History database does not exist.
  - Disable SQL execution using a safe existing fallback path.
  - Reset accumulated history when profiles or the search query change.

- extensions/brave/src/components/BraveProfileDropdown.tsx
  - Replace stale cached profile selections after loading profiles.

- extensions/brave/src/util/index.ts
  - Resolve Local State from the selected Stable, Beta, or Nightly installation.

- extensions/brave/src/constants.ts
  - Remove the stable-only Local State path.

- extensions/brave/CHANGELOG.md
  - Document the missing-database and profile-discovery fixes.

Validation:
- npm run lint
- npm run build
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: brave Issues related to the brave extension platform: macOS labels Aug 14, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your first contribution! 🎉

🔔 @ron-myers @rgomezcasas @crisboarna @tleo19 @faridrashidi @pernielsentikaer 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="fix/brave-missing-history"
FORK_URL="https://github.com/raulkolaric/extensions.git"
EXTENSION_NAME="brave"
REPO_NAME="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 15 business days.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes Brave history search tolerate profiles without a History database and resolves profile metadata from the selected Brave installation.

  • Filters unavailable profile databases before querying history.
  • Resets cached profile selection when it is absent from the selected installation.
  • Derives the Local State path from the active Stable, Beta, or Nightly profile root.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
extensions/brave/src/hooks/useHistorySearch.tsx Filters profiles without History databases and sequences SQL queries across the remaining profiles.
extensions/brave/src/components/BraveProfileDropdown.tsx Replaces stale cached profile selections with an available profile or the default ID.
extensions/brave/src/util/index.ts Resolves Local State from the selected Brave installation instead of always using Stable.
extensions/brave/src/constants.ts Removes the obsolete Stable-specific Local State path constant.
extensions/brave/CHANGELOG.md Adds release notes for the missing-history and installation-specific profile fixes.

Reviews (3): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile

Comment thread extensions/brave/CHANGELOG.md Outdated
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@raulkolaric
raulkolaric marked this pull request as ready for review August 14, 2026 18:32
@0xdhrv 0xdhrv self-assigned this Aug 15, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit a3ab31f into raycast:main Aug 16, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/ron-myers/brave

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@raulkolaric).

Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

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

Labels

extension: brave Issues related to the brave extension extension fix / improvement Label for PRs with extension's fix improvements platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Brave] ... [Brave]

3 participants