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

# Observe the rename result

> Tell apart the commit, the CRM answer and the later source observation

> [!NOTE]
>
> These examples describe the current Bijection CLI and SDK source. Use builds
> from the same source commit for these APIs. The public CLI and npm SDK
> are published independently and may lag this reference.

A committed `customers.rename` proves that the requested name and the task
committed. It does not prove that the CRM applied the name.

## Read the result

The continuation declares an argument `result: t.result(api.renameCustomer)`.
The delivery of the task fills it with the task's `Result`:

```ts bijection/customers.ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
export const renamed = mutation(
  {
    under: crm,
    args: { customer: t.key(customers), account: t.string, name: t.string, result: t.result(api.renameCustomer) },
  },
  async (ctx, { customer, account, name, result }) => {
    const fact = await ctx.get(customers(customer));
    if (fact === null || fact.rename?.name !== name) return;
    const rename = result.ok
      ? { name, ...renameResult(result.value, account, name) }
      : result.code === "Unknown"
        ? // The key's retention ran out with the answer still lost.
          { name, status: "unknown", detail: result.message }
        : { name, status: "failed", detail: result.message };
    await ctx.patch(customers(customer), { rename });
  },
);
```

`renameResult` is the example's own pure helper in `bijection/crm.ts`: it
reads the CRM's answer into one of the statuses below.

| `rename.status` | Meaning |
| - | - |
| `sent` | The task committed; no answer yet |
| `applied` | A 200 receipt names the addressed customer and the requested name |
| `conflict` | 412: the account changed since it was read; read it again and retry |
| `pending` | 202, or a pending receipt |
| `rejected` | The CRM rejected the rename |
| `unknown` | The result is `Unknown`: the answer stayed lost past the key's retention |
| `failed` | The task was refused or failed before an answer |

A send whose answer was lost is resent under the same `once` and bytes, so the
CRM answers its original receipt. Never submit with a new `once` to "retry" an
`Unknown` result: that is a second rename.

## See the observation

An applied rename is not an observation. `customers.directory` shows the
`requested_name` beside the CRM's `observed_name`, which changes only when the
feed reads the account back on its next pass. Writers can ask for a pass now
with `feed.control.refresh`; a pass that starts before the CRM applied the
rename cannot observe it.

Continue with the
[customer account example](https://docs.bijection.com/examples/customer-account-workflow.md) as the app map.


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