[Brave] Fix missing history database crash - #30219
Conversation
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
|
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 commandsBRANCH="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 devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. |
Greptile SummaryThe PR makes Brave history search tolerate profiles without a History database and resolves profile metadata from the selected Brave installation.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 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. |
Description
Root Cause
@raycast/utilsvalidates the database path whenuseSQLis 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 lintnpm run buildFixes #30131
Fixes #30153