Commit fa3bd66
committed
fix(worker): store iv as hex string instead of raw bytes
The SavedPackageData.iv column is String(255), but the worker was
writing the raw bytes returned by os.urandom(16). SQLAlchemy/psycopg2
serialize bytes-into-text as PostgreSQL's BYTEA literal "\x..." +
hex, which then flowed straight to the client through /blob's JSON
response. The frontend tried to use that as a hex IV, AES-CBC produced
garbage, and the loading screen was stuck on "processing" forever.
Fix: write iv.hex() at the worker. App's /blob handler now just
returns row.iv as-is — the previous defensive bytes-to-hex check was
masking the real bug.
Existing rows written before this fix still carry the "\x..." prefix
and need to be reprocessed (delete + POST /process).1 parent 21cb538 commit fa3bd66
2 files changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | 241 | | |
246 | 242 | | |
247 | | - | |
| 243 | + | |
248 | 244 | | |
249 | 245 | | |
250 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
916 | 919 | | |
917 | 920 | | |
918 | | - | |
| 921 | + | |
919 | 922 | | |
920 | 923 | | |
921 | 924 | | |
| |||
0 commit comments