Skip to content

Fix search suggestions error for long search queries#6955

Merged
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
absidue:long-query-error
Mar 3, 2025
Merged

Fix search suggestions error for long search queries#6955
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
absidue:long-query-error

Conversation

@absidue
Copy link
Member

@absidue absidue commented Mar 2, 2025

Fix search suggestions error for long search queries

Pull Request Type

  • Bugfix

Description

When a long search query was entered into the search box we were catching it before sending it to YouTube's search suggestions endpoit to avoid YouTube erroring but because we were returning undefined as the result, it was causing errors in FreeTube because the calling code expected an array. This pull request fixes that by returning an empty array in that case. I also got rid of the unnecessary log about the query being too long, in my mind there is no point logging an error for something that isn't actually an error, especially because the user wouldn't even see it.

Screenshots

error-messages

Testing

  1. Make sure sure you are using the local API.
  2. Enter a search query that is longer than 100 characters into the search box e.g. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
  3. No errors should appear in the dev tools console.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: feba04a

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 2, 2025
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 2, 2025 16:43
Copy link
Member

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

dfw2xba-316957d9-cf2a-4091-9775-6d0bab7dd4ea

@FreeTubeBot FreeTubeBot merged commit 9bf297f into FreeTubeApp:development Mar 3, 2025
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 3, 2025
@absidue absidue deleted the long-query-error branch March 3, 2025 06:38
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Mar 5, 2025
* fix-legacy-alone:
  Allow legacy formats to be used even when dash and audio-only are unavailable
  Fix search not working on mobile because of undefined ref (FreeTubeApp#6706)
  Bump bgutils-js from 3.1.3 to 3.2.0 (FreeTubeApp#6960)
  Bump copy-webpack-plugin from 12.0.2 to 13.0.0 (FreeTubeApp#6964)
  Bump babel-loader from 9.2.1 to 10.0.0 in the babel group (FreeTubeApp#6957)
  Bump yaml-eslint-parser from 1.2.3 to 1.3.0 in the eslint group (FreeTubeApp#6958)
  Bump lefthook from 1.11.0 to 1.11.2 (FreeTubeApp#6961)
  Bump sass from 1.85.0 to 1.85.1 (FreeTubeApp#6965)
  Bump stylelint from 16.14.1 to 16.15.0 in the stylelint group (FreeTubeApp#6959)
  Bump electron from 34.2.0 to 34.3.0 (FreeTubeApp#6962)
  Bump shaka-player from 4.13.4 to 4.13.6 (FreeTubeApp#6963)
  Translated using Weblate (Welsh)
  Fix search suggestions error for long search queries (FreeTubeApp#6955)
  Fix ctrl+click to reset playback rate not working (FreeTubeApp#6943)
  Translated using Weblate (Romanian)
  IV RSS Subscriptions: properly detect `error channels` (FreeTubeApp#4407)
  Translated using Weblate (Romanian)
  Move screenshot fallback path handling to the main process (FreeTubeApp#6945)
  Translated using Weblate (Romanian)
doublecrow pushed a commit to doublecrow/FreeTube that referenced this pull request Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants