B4: Alert threshold uses INTEGER type - risk of overflow #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
File:
web/migrations/001_initial_schema.js:93Alert
thresholdcolumn is typed as PostgreSQLINTEGER(4-byte, max 2^31-1 = ~2.1B).Impact
Signal values (green/red columns) are also
INTEGER. If signals exceed ~2.1B or user enters a large threshold, comparison silently wraps. Low risk currently, but a ticking time bomb for long-running factories.Code reference
Fix
Change to
bigint(requires new migration). Signal columns should also be migrated tobigintfor consistency.