---
title: "Persist a notification channel preference"
description: "Verify a per-category notification preference saves and remains consistent across settings reloads, with a prepared delivery probe for that channel."
canonical_url: "https://vostride.com/agent-library/notifications/channel-preference-persistence.md"
md_url: "https://vostride.com/agent-library/notifications/channel-preference-persistence.md"
content_kind: "recipe"
topic: "notifications"
---

# Persist a notification channel preference

Verify a per-category notification preference saves and remains consistent across settings reloads, with a prepared delivery probe for that channel.

## Risk

A toggle can remain visually off in local state while the server continues sending the same channel. Combine UI persistence with a controlled synthetic event and independent channel evidence.

## Fixtures

- A test-only account routes email notifications to a non-delivering mail sink, never a real recipient.
- The prepared category Build failures has an enabled email preference and a separate in-app preference that should stay enabled.
- An approved fixture verifier can inspect sink messages and in-app events for one unique synthetic build event.

## Steps

1. Open notification settings and verify Build failures has both email and in-app channels enabled.
2. Disable only email for that category, save, and verify a saved-state confirmation.
3. Reload settings and verify email remains disabled while in-app remains enabled.
4. Trigger the prepared synthetic build failure and verify its in-app notification appears.
5. After the defined delivery window, verify the mail-sink check finds no email for the fixture event while confirming the event was produced.

## Expected results

- The saved preference changes only the intended category and channel.
- The positive in-app event proves the synthetic trigger occurred while the disabled email channel remains silent.
- The absence assertion is bounded by the prepared channel delivery window and exact event identifier.

## False-pass traps

- A settings screenshot alone cannot establish that the delivery service honors the preference.
- Checking a real mailbox or sending to real users is outside this disposable fixture setup.

## Cleanup

- Restore the test account channel preference and purge the synthetic event from the inbox and mail sink.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Notification QA recipes](/agent-library/notifications.md)
- [Software factory QA library](/agent-library.md)
