---
title: "Handle a notification whose target was deleted"
description: "Verify a stale notification leads to an informative unavailable state with a usable return path after its referenced test record is removed."
canonical_url: "https://vostride.com/agent-library/notifications/deleted-target-notification.md"
md_url: "https://vostride.com/agent-library/notifications/deleted-target-notification.md"
content_kind: "recipe"
topic: "notifications"
---

# Handle a notification whose target was deleted

Verify a stale notification leads to an informative unavailable state with a usable return path after its referenced test record is removed.

## Risk

Notifications can outlive the entities they reference. The resulting route should explain the missing target without showing another similarly named record or trapping the user on an unhandled error.

## Fixtures

- A disposable task has a prepared in-app notification with a known event and task identifier.
- Fixture setup deletes the task after creating its notification while retaining the notification itself.
- A second accessible task has a similar title to detect accidental fallback or overly broad record lookup.

## Steps

1. Open the inbox and verify the stale fixture notification remains visible with its original summary.
2. Open it and verify the app presents its documented unavailable or deleted-record state.
3. Verify no detail content from the similar surviving task is presented as the missing task.
4. Use the available return-to-inbox or project navigation control and verify a usable list opens.
5. Open the surviving control task normally and verify its own identifier and body remain intact, proving the failure state did not disrupt unrelated navigation.

## Expected results

- The stale link produces a handled unavailable state corresponding to the deleted identifier.
- No replacement record is silently chosen based on a title match.
- The user can recover through visible navigation, and unrelated task detail remains accessible.

## False-pass traps

- A generic blank screen or endless loading indicator is not an informative missing-target state.
- A successful redirect to the project list alone may omit the required explanation; apply the actual product contract.

## Cleanup

- Delete the stale notification and surviving control task through fixture cleanup.

## 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)
