Skip to content

fix(mobile): guard comment components against undefined track from lineup cache#14493

Closed
dylanjeffers wants to merge 1 commit into
mainfrom
fix/comment-drawer-undefined-track-guard
Closed

fix(mobile): guard comment components against undefined track from lineup cache#14493
dylanjeffers wants to merge 1 commit into
mainfrom
fix/comment-drawer-undefined-track-guard

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

What

Hardens the comment-drawer components against an undefined track when the drawer is opened from a lineup/feed track tile (where the track is hydrated from the partial lineup cache, not the full track-screen fetch).

  • CommentBlock: bail with if (!track) return null before CommentBlockInternal dereferences track.track_id / track.pinned_comment_id / track.duration.
  • CommentOverflowMenu: optional-chain the context track accesses (track?.pinned_comment_id, track?.permalink).

Why

The comment section context types track as always-present (track: Track) and the provider returns null until the track loads — so under normal flow these are safe. This is belt-and-suspenders hardening for the tile-open path, the same family as the already-merged crash fixes:

Note on the live RC crash

While investigating I found the current release-candidate branches (release-client-v*, up to v1.5.164) do not contain #14490 or #14492 — both merged to main on Jun 16–17. If testers are still crashing on the comment button, the most likely cause is that the RC build predates those fixes, independent of this PR. Worth confirming the RC's build commit / CodePush channel.

Test plan

  • npx tsc --noEmit (packages/mobile) — clean
  • npx eslint on both files — clean

🤖 Generated with Claude Code

…neup cache

When the comment drawer is opened from a lineup/feed track tile, the track is
hydrated from the partial lineup cache and can momentarily be undefined in the
comment section context (which types `track` as always-present). Add an
undefined-track guard in `CommentBlock` and optional-chain the `track`
accesses in `CommentOverflowMenu` so the drawer doesn't crash on open with
partial tile data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f0f2348

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers

Copy link
Copy Markdown
Contributor Author

Closing as redundant — CommentSectionProvider already returns null when track is undefined (commentsContext.tsx:230), so CommentBlock and CommentOverflowMenu as provider children can never see an undefined track. The underlying blank-drawer root cause was fixed in #14494, which gates the drawer itself on the loaded track. This PR's guards would be dead code.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant