# `CommitOptions.expectGroup`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Property of [`CommitOptions`](CommitOptions.md) · inherited by [`WriteOptions`](WriteOptions.md), [`TransactionOptions`](TransactionOptions.md) · stable · since 2.0.0

```ts
expectGroup?: HistoryGroup;
```

A guard, checked at the call: this write belongs to the undo group you are running. It is
refused 'conflict' at its call unless that group is open then (a shopper write's call, a call
of [`undo()`](Session.undo.md) or [`redo()`](Session.redo.md), `commit()`, its timeout or its signal ends it); a write called while
the group is open is never refused because the group ended before its commit point.
It is not membership: every write that makes an undo step (a recorded change, or a labelled
look write) called while a group is open joins that group's undo step,
also when it commits after the group ended, unless history changed first; [`undo()`](Session.undo.md) and
[`redo()`](Session.redo.md) end the group and never join it (spec section 6.1, O9, O14).

**Default:** undefined

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `expectGroup` names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | not recorded: no ledger row names this member or its owner |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |
