Skip to content

Conversation

@absidue
Copy link
Member

@absidue absidue commented Mar 25, 2024

Fix extracting the subscriber count from channel PageHeader nodes

Pull Request Type

  • Bugfix

Description

This pull request fixes the error that randomly appears when refreshing subscriptions (it's part of the PageHeader node on user channels A/B test, which we added support for in #4543)

Cannot read properties of undefined (reading 'text')

The issue was caused by YouTube changing the position of the subscriber count in the arrays, which causes an error because it no longer exists where the code was looking for it. To avoid that happening again, I decided to search for the subscriber count instead of hardcoding the array indexes. Unfortunately that means that we have another part of the local API extractor that depends on a language specific string in YouTube's response.

Testing

Refresh your subscriptions with the local API without RSS, you shouldn't see any error messages appear anymore.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.19.2 and nightlies

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 25, 2024 17:38
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 25, 2024
@FreeTubeBot FreeTubeBot merged commit b04e349 into FreeTubeApp:development Mar 27, 2024
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 27, 2024
@absidue absidue deleted the fix-pageheader-subs branch March 27, 2024 06:33
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Apr 2, 2024
* development: (72 commits)
  Add support for CommentViews in video comments (FreeTubeApp#4806)
  Add support for LockupViews on the channel podcasts tab (FreeTubeApp#4767)
  Bump youtubei.js from 9.1.0 to 9.2.0 (FreeTubeApp#4836)
  Bump swiper from 11.0.7 to 11.1.0 (FreeTubeApp#4837)
  Bump the stylelint group with 1 update (FreeTubeApp#4835)
  Bump the eslint group with 1 update (FreeTubeApp#4834)
  Bump electron from 29.1.5 to 29.1.6 (FreeTubeApp#4838)
  Translated using Weblate (Estonian)
  Fix v-observe-visibility error when playlist items are updated (FreeTubeApp#4774)
  Fix extracting the subscriber count from channel PageHeader nodes (FreeTubeApp#4804)
  Translated using Weblate (Portuguese)
  Create empty subscriptions cache objects directly instead of cloning (FreeTubeApp#4814)
  Parse compact numbers without using floating point numbers to avoid accuracy issues (FreeTubeApp#4817)
  Fix the left arrow key not working on the first button in prompts (FreeTubeApp#4816)
  Fix the web build's manifest.json file getting included in the electron build (FreeTubeApp#4815)
  Move usingElectron from computed into data (FreeTubeApp#4810)
  Stop setting node modules path now that we bundle the modules (FreeTubeApp#4809)
  Translated using Weblate (Bulgarian)
  Bump express from 4.18.1 to 4.19.2 (FreeTubeApp#4812)
  Translated using Weblate (Portuguese (Brazil))
  ...
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