# React: preserve requirements through advanced agent edits - [Keep old React search responses from replacing the current query](https://frameworkrecipes.dev/react/stale-request-cleanup/guide.md): Requests can complete in a different order from the queries that started them. Aborting reduces wasted work; invalidating the old effect prevents a response already resolving from writing stale state. Protect the error branch as well as successful results. - [obsolete-search-does-not-update rule pack](https://reporules.fyi/react/stale-request-cleanup/rule-pack.zip): YAML requirement and agent task. - [Serialize and roll back an optimistic React cancellation](https://frameworkrecipes.dev/react/optimistic-mutation-rollback/guide.md): An optimistic UI can falsely display a completed transition after the server rejected it. Keep a snapshot, allow only one mutation at a time, and use the server-returned state on acknowledgement. A rejected operation restores the local snapshot and exposes its failure. - [optimistic-failure-restores-state rule pack](https://reporules.fyi/react/optimistic-mutation-rollback/rule-pack.zip): YAML requirement and agent task. - [Framework rule pack](https://reporules.fyi/react/rule-pack.zip): All requirements from this framework site.