# Version 2.6.2 Safe Polling Mode

This patch turns TextBee polling back on safely while preventing duplicate messages.

## Why

The initial SMS is now being delivered, but customer replies are not appearing in the lead dashboard. The webhook URL looks correct, so the fastest reliable fallback is to enable TextBee polling.

## What changed

### 1. Polling can be enabled by env again

Set:

TEXTBEE_INBOUND_POLLING_ENABLED=true

If env is explicitly true, polling starts even if an old System Settings value was false.

If env is explicitly false, polling stays off.

If env is blank/missing, the app uses the System Settings toggle.

### 2. Active inbound duplicate lock

If the same inbound message arrives through webhook and poller at the same time, the app processes only the first one.

Log:

[Incoming SMS skipped: active duplicate already processing]

### 3. Existing body/provider duplicate protection remains

If the webhook saves the message first, the poller duplicate is blocked by body/provider dedupe.

Log:

[Incoming SMS duplicate body suppressed before save]

### 4. Active outbound duplicate lock

If two processing paths try to send the same AI reply at the same time, the app sends only one.

Log:

[Customer SMS reply skipped: active duplicate already sending]

## Recommended settings

.env:

TEXTBEE_INBOUND_POLLING_ENABLED=true
TEXTBEE_INBOUND_POLLING_INTERVAL_SECONDS=30
TEXTBEE_INBOUND_POLLING_LIMIT=25

/admin/system:

TextBee Inbound Polling Fallback = True / active

## Expected behavior

- Initial text sends once.
- Customer reply appears once in the dashboard.
- AI reply sends once.
- Webhook + poller duplicates are suppressed.
