Skip to content

Make sure description isn't null when extracting chapters from description#7505

Merged
FreeTubeBot merged 2 commits intoFreeTubeApp:developmentfrom
ChunkyProgrammer:check-description-null
Jun 17, 2025
Merged

Make sure description isn't null when extracting chapters from description#7505
FreeTubeBot merged 2 commits intoFreeTubeApp:developmentfrom
ChunkyProgrammer:check-description-null

Conversation

@ChunkyProgrammer
Copy link
Member

Pull Request Type

  • Bugfix

Related issue

closes #7503

Description

result.basic_info.short_description and result.secondary_info.description.text are both nullable strings and for whatever reason both returned null from Rune's testing

Testing

  • Go to https://youtu.be/A1IlubXQpL8
  • Don't receive error, TypeError: Cannot read properties of undefined (reading 'matchAll') (error is inconsistent so we must try multiple times)

Desktop

  • OS: Fedora Linux
  • OS Version: 42
  • FreeTube version: latest git commit

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 3, 2025 10:58
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jun 3, 2025
absidue
absidue previously requested changes Jun 3, 2025
Copy link
Member

@absidue absidue left a comment

Choose a reason for hiding this comment

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

Before we do a fix to just make the error go away, we should check that the description is actually completely missing in those responses or whether it has been moved to somewhere else in the response structure, in which case we should extract it from the new location. My suspicion is that it is the latter (yt-dlp has had reports recently about the translated title not being extracted, which sounds related) and an A/B test which would explain why it can't be reproduced consistently.

Unfortunately @efb4f5ff-1298-471a-8973-3d47447115dc wasn't able to reproduce it with the devtools attached, so we currently only have the error message (in electron/chromium logs are captured all the time, requests and responses are only captured while devtools are open).

I'm not blocking this pull request entirely, I just want to be sure that this is the right fix. If we don't have an answer right before we do the next release, I am happy to approve it as-is so that users don't see the error.

@efb4f5ff-1298-471a-8973-3d47447115dc

I've caught the error again and shared the responses

@ChunkyProgrammer
Copy link
Member Author

Looks like it has a placeholder (descriptionPlaceholder) saying that the description is empty now:

              {
                "expandableVideoDescriptionBodyRenderer": {
                  "descriptionPlaceholder": {
                    "content": "No description has been added to this video.",
                    "styleRuns": [
                      {
                        "startIndex": 0,
                        "fontColor": 4284506208,
                        "italic": true
                      }
                    ]
                  }
                }
              },

@absidue
Copy link
Member

absidue commented Jun 3, 2025

As it looks like the description is actually missing and it seems like YouTube is just switching how they handle videos without a description, I'll remove my block.

@absidue absidue self-requested a review June 3, 2025 21:07
@absidue absidue dismissed their stale review June 3, 2025 21:07

outdated

absidue
absidue previously approved these changes Jun 3, 2025
@efb4f5ff-1298-471a-8973-3d47447115dc

Got this message

VirtualBoxVM_yVQPBCMe6F

@ChunkyProgrammer ChunkyProgrammer added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Jun 8, 2025
@ChunkyProgrammer ChunkyProgrammer force-pushed the check-description-null branch from 04c62f8 to 87a48fd Compare June 17, 2025 11:54
@ChunkyProgrammer ChunkyProgrammer added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Jun 17, 2025
@absidue absidue disabled auto-merge June 17, 2025 20:34
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 17, 2025 20:34
@FreeTubeBot FreeTubeBot merged commit 5485c56 into FreeTubeApp:development Jun 17, 2025
6 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jun 17, 2025
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Jun 23, 2025
* development: (214 commits)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (French)
  Translated using Weblate (French)
  add search filter reset button (FreeTubeApp#7531)
  ! Fix variant selection when no variant's audio role marked as main (FreeTubeApp#7571)
  Make sure description isn't null when extracting chapters from description (FreeTubeApp#7505)
  Translated using Weblate (French)
  Bump stefanzweifel/git-auto-commit-action from 5 to 6 (FreeTubeApp#7564)
  Translated using Weblate (Swedish)
  Bump the eslint group with 3 updates (FreeTubeApp#7567)
  Bump sass from 1.89.1 to 1.89.2 (FreeTubeApp#7565)
  Bump shaka-player from 4.14.15 to 4.14.18 (FreeTubeApp#7566)
  Bump postcss from 8.5.4 to 8.5.5 in the stylelint group (FreeTubeApp#7568)
  Bump electron-builder from 26.0.16 to 26.0.17 (FreeTubeApp#7569)
  Translated using Weblate (English (United Kingdom))
  add beta to asset name (FreeTubeApp#7512)
  Translated using Weblate (Dutch)
  Translated using Weblate (Dutch)
  Fix builds failing due to broken Weblate keys (FreeTubeApp#7560)
  Translated using Weblate (Persian)
  ...

# Conflicts:
#	package.json
#	src/renderer/helpers/api/local.js
efb4f5ff-1298-471a-8973-3d47447115dc pushed a commit to efb4f5ff-1298-471a-8973-3d47447115dc/FreeTube that referenced this pull request Aug 6, 2025
…ption (FreeTubeApp#7505)

* Make sure description isn't null when extracting chapters from description

* set default value for description to empty string
@ChunkyProgrammer ChunkyProgrammer deleted the check-description-null branch August 27, 2025 18:42
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.

[Bug]: Watch page - TypeError: Cannot read properties of undefined (reading 'matchAll')

5 participants