airbytehq / airbytehq/airbyte

events_detailed stream missing lookback_window causes 0-record syncs

未關閉
#70,341 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
area/connectors autoteam community connectors/source/klaviyo needs-triage team/extensibility team/use type/bug
主要語言
Python
星號
22.1k
分支
5.4k
平均合併
5 小時
30 天內合併 PR
671

描述

### Connector Name

source-klaviyo

### Connector Version

2.16.8

### What step the error happened?

During the sync

### Relevant information

The events_detailed stream intermittently syncs 0 records because it lacks the lookback_window state management that other Klaviyo streams have. When the cursor advances to a future timestamp, subsequent syncs request data that doesn't exist yet.

**Evidence**
Working streams have lookback protection:
```
{
"name": "campaigns_detailed",
"streamState": {
"lookback_window": 7,
"updated_at": "2025-12-03T22:35:08+0000"
}
}
```

events_detailed lacks this feature:
```
{
"name": "events_detailed",
"streamState": {
"datetime": "2025-12-04T20:42:53+0000"
}
}
```

## The Problem

1. Successful sync at `2025-12-04 01:58:40 UTC` pulls 89,316 records
2. Cursor advances to `2025-12-04T20:42:53+0000` (18 hours in the future)
3. Next sync at `2025-12-04 07:57:51 UTC` asks for events > `20:42:53`
4. Klaviyo returns 0 records (cursor is still 12+ hours in the future)
5. Sync completes with 0 bytes transferred

## Root Cause
Klaviyo **events can have datetime values ahead of real-time** (scheduled campaigns, timezone handling). Other streams handle this with lookback_window, but events_detailed doesn't.

## Reproduction

Configure events_detailed for incremental sync (4x daily schedule)
Observe ~25% of syncs return 0 records
Check connection state - cursor will be in the future

## Expected Behavior
events_detailed should have lookback_window like other streams to handle future-dated events.
Workaround
Manually reset cursor backwards 2-3 days in connection state.
Environment

Airbyte Cloud
Sync mode: Incremental | Dedupe
Frequency: 4x daily

### Relevant log output

```shell
**0-record sync completes instantly:**

2025-12-02 19:58:53 info Read 0 records from events_detailed stream
2025-12-02 19:58:53 info Marking stream events_detailed as STOPPED

**Working sync processes normally:**

2025-12-04 01:58:56 info Records read: 5000 (9 MB)
2025-12-04 02:05:08 info Read 89316 records from events_detailed stream
```

### Contribute

- [ ] Yes, I want to contribute

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。