Skip to content

fix(sync): emit sortAt ops by TARGET name in seconds (source-name ops silently dropped) - #334

Merged
JustMaier merged 1 commit into
mainfrom
fix/sortat-op-target-name
Jul 18, 2026
Merged

fix(sync): emit sortAt ops by TARGET name in seconds (source-name ops silently dropped)#334
JustMaier merged 1 commit into
mainfrom
fix/sortat-op-target-name

Conversation

@JustMaier

Copy link
Copy Markdown
Contributor

Prod bug found 2026-07-18 during W4: steady-state sortAt ops emitted as sortAtUnix (ms) were silently ignored — the data_schema rename layer is doc-path only; op fields resolve against TARGET names (ops_processor process_set_op) and unknown fields drop without error. publishedAt worked because it always emitted the target name.

Evidence: single-op experiment against prod (correct-value sortAtUnix set applied, doc + layers unchanged); same-batch publishedAt applied. Full writeup in the session; heal re-run follows trigger regeneration.

Emission now: field sortAt, SECONDS, same COALESCE belt, same shared function name (re-emitter parity intact). Suite 1250 green; review SQL regenerated.

🤖 Generated with Claude Code

…s are silently dropped

The W1-1/W2-1 design emitted the Image trigger's sort value as field
'sortAtUnix' in milliseconds, assuming the data_schema
sortAtUnix->sortAt (ms_to_seconds) mapping applied at op ingestion.
It does not: data_schema source->target renames apply to DOCUMENT keys
(dump/insert path) only. Op Set/Remove fields resolve raw against
filter/sort TARGET names (ops_processor process_set_op) and unknown
fields are silently ignored — so every steady-state sortAt op was
dropped in prod (~5h, 2026-07-17/18) while publishedAt (target-name)
ops in the same batches applied fine. Proven by a single-op experiment
against prod; every other field always emitted target names.

Fix: the shared expression + shared_ops_fields emit field 'sortAt' in
SECONDS (no *1000). Function name bitdex_image_sortat_ops is unchanged
(re-emitter parity preserved). The dormant sortAtUnix->sortAt doc
mapping stays for the dump path. Tests updated to pin target-name +
seconds and to reject source-name emission; trigger-sql-review.sql
regenerated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@JustMaier
JustMaier merged commit 52b5d5e into main Jul 18, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant