> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usestatemachines.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find missing or unexpected data

> Check environment identity, snapshot selection, app names, actors, and write results.

Before you change the query, confirm which environment and app the client reached. Fresh environments and restored environments have different starting data, and actors can see different records.

## Confirm the target

Read the environment by ID. Match the app name to the name used at creation. If an environment contains two Salesforce copies, `connect('salesforce')` and `connect('partner-org')` reach different app data.

Check that the client uses credentials from this environment. Credentials copied from another test can point at a still-running environment with older records. Obtain fresh credentials through the intended environment's `connect()` helper.

## Check the starting data

An environment created with `apps` starts with its app version's predefined data. It does not contain your customer Salesforce records. Creating a snapshot also does not import data from a customer organization.

An environment created with `snapshotId` starts from that saved copy. Confirm the snapshot ID, its source, and its status. A descriptive name helps people find a fixture, but the ID determines what is restored.

Writes to a restored environment do not update the snapshot. If the fixture needs new records, create a new snapshot after preparing them and update the ID used by tests.

## Verify the write and actor

Read the original write response and check `response.ok`. A request that returned `400` did not satisfy the test's success condition. [Credentials and actors](/environments/credentials#request-behavior) describes how `credentials.fetch()` returns HTTP errors.

For a successful write that a later query cannot see, confirm the actor, queried object, record identifier, and query filters. Restricted actors may have different record access than the administrator. A test that changes actors also changes the access being tested.

After an ambiguous network failure, inspect records through a stable identifier before repeating the write. A blind retry can create duplicates.

## Account for deletion and expiry

A paused or failed environment keeps its app data for one day, then State Machines deletes it. Deleting an environment removes its app data. Management history, including recorded request bodies, is separate. A time limit or automatic expiry can delete the environment without another client call. Inspect status and audit events to understand what happened.

A ready snapshot can outlive its source environment. Deleting the snapshot does not erase data in environments already created from it. See [snapshot reuse](/snapshots/reuse) and [environment lifecycle](/environments/lifecycle) for their independent ownership.

If the concern is a sensitive value in request history, review [recorded data handling](/environments/security). Deleting the app environment does not erase copies in request records, snapshots, local downloads, or agent transcripts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.