fix(idn-admin-regions): impor menulis SQL NULL, bukan string "null" - #396
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
`tx.array(values, "text")` tidak bisa membawa SQL NULL — Bun menyerialkan elemen `null` menjadi teks empat karakter "null", dan bentuk tanpa tipe pun tidak menghasilkan NULL (diprobe terhadap PostgreSQL 18.4 di Bun 1.3.14: `x IS NULL` mengembalikan false untuk keduanya). Ditemukan pada impor NYATA ke staging, bukan dengan membaca: ke-38 provinsi mendarat ber-`parent_code` = 'null', dan seluruh 7.285 kecamatan ber-`local_term` = 'null' — teks yang dirender apa adanya oleh konsumen, sekaligus membuat setiap filter `IS NULL` mengembalikan nol baris. Delapan kolom nullable terdampak; nol SQL NULL di seluruh tabel. Null kini melintas sebagai sentinel string kosong dan dipulihkan `NULLIF(t.col, '')` di SELECT. Sentinel aman karena tak satu pun kode, nama, atau local term wilayah yang sah bernilai kosong, dan pemulihannya tetap benar bila Bun kelak mengirim NULL sungguhan. Digerbangi test integrasi: cacat ini hidup di batas serialisasi, jadi typecheck dan test murni tidak bisa melihatnya. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ahliweb
force-pushed
the
fix/idn-regions-import-null-columns
branch
from
August 5, 2026 10:08
40b3aea to
4281259
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ditemukan saat mengimpor dataset wilayah ke staging (91.599 baris): nol SQL NULL di seluruh tabel — setiap kolom nullable berisi teks empat karakter
"null".'null'parent_codelocal_termvillage_codedistrict_coderegency_codeSebabnya
tx.array(values, "text"): Bun menyerialkan elemennulljadi string"null". Diprobe langsung, bukan disimpulkan —sql.array(["a", null, "b"], "text")mengembalikanx = "null"denganx IS NULL= false; bentuk tanpa tipe juga bukan NULL.Perbaikannya sentinel eksplisit +
NULLIF(t.col, ''), jadi benar terlepas dari perilaku Bun sekarang maupun nanti. Digerbangi test integrasi karena cacat ini tak terlihat oleh typecheck maupun test murni.🤖 Generated with Claude Code