fix(web): confirm before publishing a collection's hidden tracks#14524
Merged
dylanjeffers merged 1 commit intoJul 16, 2026
Conversation
Making a hidden playlist or album public force-published every hidden child track, with no distinction between a track the user deliberately hid and a scheduled pre-release, and no confirmation. Hidden tracks could go public unintentionally. Publishing now prompts when the collection contains deliberately-hidden tracks, offering to publish them alongside the collection or to keep them hidden. The collection is published either way. Scheduled releases are unaffected: they still publish only as an early release. The prompt is raised in the collections sagas so it covers every publish entry point (the publish button, the overflow menus, the collection page and the edit form) rather than each caller having to remember it. Mobile shares these sagas but renders no drawer for the prompt yet, so it keeps the previous behavior until that lands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Making a hidden playlist or album public force-published every hidden child track, silently. The cascade in
commonSagas.tswas:This drew no distinction between a track the user deliberately hid and one that is simply a scheduled pre-release, and asked for no confirmation. A user publishing a playlist could unintentionally make hidden tracks public — not something they can quietly undo, since publishing notifies followers.
User-facing change
When a user publishes a collection that contains deliberately-hidden tracks (
is_unlisted && !is_scheduled_release), they now get a prompt naming how many:The collection itself is published on both paths; the choice only controls the cascade. Dismissing the modal (esc / overlay / X) takes the conservative path, so tracks are never published by an accidental dismiss.
No prompt appears when there is nothing to warn about, so the common case is unchanged.
Scheduled releases are unaffected. They still publish only as an early release — i.e. when the collection is itself a scheduled release and all of its tracks are scheduled. That branch never prompts.
Where the check lives
The gate is in the sagas rather than the UI. Publish is dispatched from four web call sites (the publish button,
useCollectionPage, the overflow modal, and the edit form) and today only the publish button opens any confirmation. Putting the check in the saga covers all of them, and both the edit path and the publish path, in one place — no future caller can forget it.Within the saga the prompt is raised before the write begins. The publish path applies the result inside a confirmer success callback, which serializes writes per collection; blocking there would hold that queue while the modal is up, and would deadlock the collection outright if the modal ever failed to resolve.
Two small sagas are now exported (
confirmPublishHiddenTracks,publishHiddenChildTracks) so the branch logic can be tested directly.Mobile needs a follow-up
Worth flagging, since it's not what you'd expect: mobile has no copy of this logic —
packages/mobile/src/store/cache/collections/sagas.tsimports web'scommonSagasthrough thecommon/*tsconfig alias, so mobile runs this exact code.What mobile lacks is the drawer. Prompting there would block the publish forever on a modal that never renders, so
confirmPublishHiddenTracksreturns early onisNativeMobileand keeps the previous publish-everything behavior. The follow-up is to add aPublishHiddenTracksConfirmationDrawer(alongside the existingPublishConfirmationDrawer) and delete that branch — the saga and the modal slice inpackages/commonare already shared and need no changes.Testing
12 unit tests in
publishHiddenChildTracks.test.tscover the prompt (count, album/playlist wording, confirm, keep-private, mobile) and the cascade (early release, non-scheduled collections, empty collections).Two notes for reviewers:
redux-saga-test-plan. The web vitest setup replacesredux-sagawith a stub, andredux-saga-test-planfails to load under vitest's ESM interop — which is why the package has no saga tests today.Full web unit suite passes (25 files).
tsc --noEmitclean forwebandcommon. The 7 pre-existing failures incommon'supload/selectors.test.tsare unrelated and fail onmaintoo.🤖 Generated with Claude Code