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

# Online scorer deduplication with concurrent feedback

export const plans_0 = "Any"

export const deployments_0 = "Braintrust-hosted, Self-hosted"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Online scorers with multiple concurrent feedback API calls updating the same span"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

Summary

**Issue:** Online scorers don't re-trigger for all feedback calls when multiple `feedback` API calls update the same span's `expected` field in quick succession, and only the last feedback value is scored.

**Cause:** Scoring requests are deduplicated by `row_id` within write-ahead log (WAL) processing batches, so only one scoring invocation executes per span per batch.

**Resolution:** Space out feedback API calls to ensure they process in separate WAL batches, or restructure your application to send only one feedback update per span.

## How Deduplication Works

When feedback calls arrive in quick succession:

1. First feedback call updates `expected`, generates scoring request with token A
2. Second feedback call updates `expected` again, generates scoring request with token B
3. Both requests enter the same WAL batch
4. Second request overwrites the first (same `row_id` key)
5. Only one scoring invocation triggers (with token B's data)

This is intentional behavior to prevent redundant scoring invocations.

## Resolution Steps

### Option 1: Space out feedback calls

#### Introduce a delay between feedback API calls for the same span.

```python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import time
from braintrust import update_span

# First feedback update
update_span(span_id, expected={"patient": None})

# Wait for first update to process
time.sleep(1)

# Second feedback update
update_span(span_id, expected={"customer": "9d50173e18664h91ab"})

```

### Option 2: Consolidate feedback updates

#### Queue feedback updates and send only the final state per span.

```python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
from braintrust import update_span

# Instead of multiple calls, determine final state first
final_expected = {"customer": "9d50173e18664h91ab"}

# Single feedback update
update_span(span_id, expected=final_expected)

```
