Commit 7931dcc
authored
fix(file-search): store workspace file revisions at millisecond precision (#7941)
* fix(file-search): store workspace file revisions at millisecond precision
The content revision round-trips through JavaScript Date and JSON, both of
which truncate to milliseconds, while now() stores microseconds. A
sub-millisecond revision stops comparing equal to its own round-trip, so
every SQL equality keyed on it matches zero rows and the file is never
claimed, indexed, or cleaned up.
Truncate at the column default and enforce it with a BEFORE trigger for the
writers a default cannot reach, then retire the rows minted before the
invariant existed in a batched script migration.
* fix(file-search): normalize revisions promoted by metadata-only writes
A chat upload is materialized into a workspace file by setting context
alone, so the revision is never written and the search-index trigger would
key the promoted file to a value nothing can claim. Fire the normalizer on
every update; `UPDATE OF` is evaluated against the statement's target
columns, so this does not demote provenance on a metadata write.
Accept the shared integration database in the repair suite the way the
sibling suites do, and record the new script migration in the registry
order assertions.
* chore(db): drop the 0357 migration ahead of renumbering
* chore(db): renumber the content revision migration to 0358
Staging took 0357 for the outbox autovacuum migration. The SQL is byte for
byte the previously reviewed file; only the number and the references to it
changed.1 parent 2112998 commit 7931dcc
10 files changed
Lines changed: 28029 additions & 2 deletions
File tree
- .github/workflows
- packages/db
- migrations
- meta
- script-migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments