# selection-conflicting

The **options** of a read or an observation **cannot be combined**.

- **Routes:** `read-events` and `observe-events`
- **Description:**
    - for `lowerBound` together with `fromLatestEvent`: `selection is conflicting: lowerBound and fromLatestEvent cannot be combined`
    - for `fromLatestEvent` together with the order `antichronological`, when reading: `selection is conflicting: fromLatestEvent requires chronological order`
- **Details:** **`fields`**, the options that cannot be combined, as a list: `["lowerBound", "fromLatestEvent"]` or `["order", "fromLatestEvent"]`.

## Why It Happens

Both `lowerBound` and `fromLatestEvent` say where a read or an observation starts: `lowerBound` at an event ID, `fromLatestEvent` at the **[latest event of a type](/learn/tutorials/first-steps-with-eventsourcingdb/reading-events#reading-from-the-last-event-of-a-given-type)** in a subject. There can only be one start, so the two **cannot be combined**. A typical cause is a client that resumes after a lost connection by adding a `lowerBound` to a request that already has `fromLatestEvent`.

When reading, **`fromLatestEvent` also requires chronological order**, the default, so a read with `order` set to `antichronological` is refused as well. If a read has both conflicts, the error names `lowerBound`. These options are checked only once every value of the request has passed, so a value that is wrong, such as a bound without its type, is reported first.

## How to Fix It

Use either `lowerBound` or `fromLatestEvent`. To **[resume after a lost connection](/learn/tutorials/first-steps-with-eventsourcingdb/observing-events#resuming-after-connection-loss)**, replace `fromLatestEvent` with a `lowerBound` that is exclusive at the ID of the last event you received. To read from the latest event of a type, leave out `order` or set it to `chronological`, and reverse the events in your client if you need the newest first. Sending the same request again fails the same way.

## Example

To read the events of `/books/42` with both a `lowerBound` and `fromLatestEvent`, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its `end` item:

```json
{
  "type": "error",
  "data": {
    "code": "https://docs.eventsourcingdb.io/errors/selection-conflicting",
    "description": "selection is conflicting: lowerBound and fromLatestEvent cannot be combined",
    "details": {
      "fields": [
        "lowerBound",
        "fromLatestEvent"
      ]
    }
  }
}
```
