Commit fdbefb2
authored
fix(state): never emit created_at on the wire (#146)
#144 removed the ts -> created_at carry but left created_at in the
allowlist the serializer filters against, so a buffer record containing
that key literally would still pass straight through. Nothing writes it
today, so this was latent rather than live — but closing exactly this kind
of door is what the allowlist is for, and the test only supplied ts so it
could not catch it.
Splits the two concepts: _INTERACTION_DATA_FIELDS stays the model-contract
set (created_at IS a real InteractionData field, and the drift test pins
the set against the model), while _WIRE_FIELDS is what the serializer
filters on and excludes it.
Why created_at must not be emitted: the extractor's bookmark is keyed on
interaction created_at (last_processed_timestamp, compared with
created_at >= ?), so a backdated batch — one recovered after the bookmark
moved — is stored and then never extracted. That is permanent, silent loss
of learning data on precisely the offline-recovery path this buffer exists
for. Letting the server stamp its own time is the lesser evil until ingest
ordering stops depending on caller-supplied event time.
Caught by CodeRabbit on #144 after it merged.1 parent ee602f1 commit fdbefb2
2 files changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| |||
436 | 446 | | |
437 | 447 | | |
438 | 448 | | |
439 | | - | |
440 | | - | |
441 | | - | |
| 449 | + | |
442 | 450 | | |
443 | 451 | | |
444 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
547 | 565 | | |
548 | 566 | | |
549 | 567 | | |
| |||
0 commit comments