Skip to content

fix(mobile): don't offer share-to-story for a track with no audio - #14584

Open
dylanjeffers wants to merge 1 commit into
mainfrom
fix/no-audio-share-to-story
Open

fix(mobile): don't offer share-to-story for a track with no audio#14584
dylanjeffers wants to merge 1 commit into
mainfrom
fix/no-audio-share-to-story

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

What happened

Michael reported that one specific link failed with "Sorry, something went wrong" when sharing to an Instagram story, while every other link worked.

That track has no audio. track_cid is null on the indexed row, so the stream endpoint 404s. Share-to-story builds a video out of the track's audio — it resolves the stream URL and passes it to ffmpeg as an input (-i ${streamMp3Url}). ffmpeg gets a 404 JSON body instead of an mp3, exits non-zero, and handleError shows the generic toast with no hint that the track itself is broken. Every other link he tried worked because those tracks had audio.

What this changes

Don't offer the story platforms for a track with nothing to play. AudiusProject/api#1032 makes the API report is_streamable: false for these rows, so isShareableTrack now excludes them — better than failing 60% of the way through a progress drawer. The check is an explicit !== false because not every track source populates the field, and an absent one must not hide the share options.

Guard the stream-URL step. signGatedContentRequest and getTrackStreamUrl were wrapped in nothing at all, and handleShare doesn't catch either — so a rejection there (a failed signature, an SDK that never initialized) escaped as an unhandled promise rejection: no toast, and the progress drawer left spinning with no way out but backing out of it. Now it goes through handleError like every other step, and the analytics error carries Error at resolve stream url step so the failing step is identifiable.

The two comment updates in packages/common bring the is_streamable docs in line with its widened meaning — it now also covers an upload indexed without its track_cid, not just deleted/deactivated.

Worth knowing

isTrackUnavailable reads the same flag, so once the API change lands, these tracks will render the "no longer available" screen on the track page instead of a dead player. That's intended, and transient for tracks the repair job in AudiusProject/api#1032 can fix.

Mobile ships via OTA and iOS OTA has been broken since the 1.5.186 build failed, so this is likely to reach iOS well after the server-side fixes land. The repair job closes the loop regardless of client version.

Testing

Lint clean on all four files; typecheck clean on the changed files. Not exercised on a device — the share-to-story path needs a real Instagram hand-off to test end to end.

🤖 Generated with Claude Code

Share-to-story builds a video out of the track's audio: it resolves the
stream URL and hands it to ffmpeg as an input. When the track has nothing
to play - an upload indexed without its track_cid - that URL 404s, ffmpeg
exits non-zero, and the user gets a bare "Sorry, something went wrong."
with no hint that the track itself is broken. That is the bug Michael
hit; every other link he tried worked because those tracks had audio.

The API now reports is_streamable=false for these, so stop offering the
story platforms at all rather than failing halfway through. The check is
an explicit `!== false` because not every track source populates the
field, and an absent one must not hide the share options.

Also guard the stream-URL step itself. Nothing wrapped it, so a rejection
there - a failed signature, an SDK that never initialized - escaped as an
unhandled promise rejection: no toast at all, and the progress drawer
left spinning with no way out but backing out of it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8431c0a

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

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