Skip to content

Allow deleting custom notification sounds - #6371

Open
feather2222 wants to merge 1 commit into
signalapp:mainfrom
feather2222:allow-deleting-custom-sounds
Open

feather2222 wants to merge 1 commit into
signalapp:mainfrom
feather2222:allow-deleting-custom-sounds

Conversation

@feather2222

Copy link
Copy Markdown

Contributor checklist

Administrative:

Commits and testing:

  • My commits are rebased on the latest main branch.
  • My commits are well-structured for review.
  • My change has been thoroughly tested, and I am not aware of any regressions to existing features or behaviors.
  • I have tested my contribution on these devices:
    • iPhone 16 Pro Simulator, iOS 26

Description

Fixes #6351.

Custom notification sounds imported by the user could never be removed: there was no way to delete a bogus sound, and importing a replacement with the same name was silently ignored.

Changes

  • Sounds.deleteCustomSound(_:) (new public API): deletes the custom sound file and clears any references to it — per-thread sound overrides stored in the sounds key-value store, and the global notification sound preference (which also rewrites the fallback notification sound file). Affected threads/settings fall back to the default sound.
  • Sound picker UI: long-pressing a custom sound row now shows a context menu with a destructive "Delete Sound" action, followed by a confirmation alert. If the deleted sound was selected in the picker, the selection resets to the default sound.
  • OWSTableItem.init(text:…): gained an optional contextMenuActionProvider parameter (defaults to nil, no behavior change for existing callers).
  • Unit tests: file deletion and reference clearing are covered by new DeleteCustomSoundTest cases.

Testing

  • Built the Signal scheme for iOS Simulator (Xcode 26.2) successfully.
  • Ran the new tests plus the existing sound tests on iPhone 16 Pro Simulator:
    • DeleteCustomSoundTest/testDeleteCustomSound — passed
    • DeleteCustomSoundTest/testDeleteCustomSoundClearsReferences — passed
    • SoundsTest/testCustomSoundId — passed
  • Note: the fallback push-notification sound file is regenerated via the existing setGlobalNotificationSound path when the deleted sound was the global one.

Custom notification sounds imported by the user could never be
removed: there was no way to delete a bogus sound, or to re-import a
sound with the same name.

Long-pressing a custom sound in the sound picker now shows a 'Delete
Sound' context menu action. After confirmation, the sound file is
deleted and any references to it (the global notification sound and
per-thread overrides) are cleared so they fall back to the default.

Fixes signalapp#6351
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.

When a custom notification has been set, there is no way to remove it from the list.

1 participant