Laporan bug
SPPBCD pada Pemeriksaan tidak bisa menyimpan data/dokumen
Ikuti perkembangan laporan dan penjelasan penyelesaiannya di halaman ini.
Selesai1 pengikut
Penjelasan perbaikan
fix(pemeriksaan): restore multi-item SPPBCD saving
## Changes
Saving an SPPBCD with two or more borrowed items fails because `sppbcd_daftar.sppbcd_id` incorrectly has a single-column unique constraint. Remove that constraint while retaining unique item codes within each SPPBCD and both foreign keys. Reject duplicate item codes before starting the save transaction.
Replace raw database errors in SPPBCD saves and examination-document upload/delete actions with readable messages. Detect duplicate letter numbers through Drizzle's wrapped PostgreSQL errors. Add regression coverage for validation, safe errors, and upload compensation that preserves the previous document.
Fixes #1884. The exact original upload failure was not reproduced; upload changes cover duplicate-number feedback and error sanitization.
## Release impact
Patch. Restore the existing SPPBCD list-saving behavior and correct error handling in the existing examination workflow. No distinct new application capability is introduced.
## Migration notes
- Production requires reviewed migration `0212_sppbcd_daftar_multiple_items` before multi-item saves can succeed.
- Development uses `0189_sppbcd_daftar_multiple_items` in its separate migration history. Do not apply both migrations to one database.
- The production migration is registered for a reviewed manual rollout with an exact SQL hash. It has no automatic deployment approval. Follow [the rollout instructions](deploy/migrations/0212_sppbcd_daftar_multiple_items/README.md).
- Existing readers and one-item writes remain compatible. Do not re-add the removed uniqueness after multi-item records exist.
- No database migration has been applied.
## Validation
Passed:
- The previously failing manual-expansion registry test passes locally after including migration `0212` in its explicit expected list.
- Focused ESLint checks for the changed TypeScript sources and new tests.
- UI policy syntax checks against base `dfd5577ffde8ad40f50911df42a330d51176fa30`.
- Drizzle query policy check with zero violations.
- Production schema/snapshot check for 505 tables.
- Static snapshot and migration-hash checks, `node --check deploy/migrations.mjs`, and `git diff --check`.
Not completed:
- Other regression tests, migration compatibility fixtures, build, and dev commands have not been run locally.
- The changed-code React Doctor audit could not run because the available dependencies do not include `react-doctor`.
- Production save/upload behavior has not been verified.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* SPPBCD documents can now include multiple borrowed items, with different item codes.
* **Bug Fixes**
* Duplicate item codes within an SPPBCD are rejected, including codes that differ only by surrounding whitespace.
* Duplicate surat numbers receive a clear prompt to choose another number.
* Document upload and deletion failures now show safer, more helpful feedback, and failed saves clean up newly uploaded documents.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Penjelasan laporan
Halaman terkait /dasbor/pemeriksaan/kertas-kerja/16/sppbcd/11
SPPBCD pada Pemeriksaan tidak bisa menyimpan data/dokumen yang dipinjam dan hampir selalu keluar peringatan
- Kategori
- Lainnya
- Dampak
- Ringan
- Frekuensi
- Sekali