Commit d7c637b
committed
refactor: improve code quality, validation, and test robustness
Query DO:
- Add table name validation in handleQuery (400 for missing/invalid)
- Fix unhandled promise in registerWithMaster (try/catch + error logging)
- Add datasetCache eviction (LRU by updatedAt, max 100 entries)
- Add filter/projection counts to error log context
Master DO:
- Validate r2Key in handleWrite/handleRefresh (reject empty or path traversal)
Conformance tests:
- Share fixture loading via beforeAll (was re-reading same files per test)
- Strengthen assertions: exact values instead of toBeGreaterThan(0)
- Fix unsafe type coercions (typeof check before bigint comparison)
- Add encoding assertions before decodeParquetColumnChunk calls
- Add edge case tests: empty filters, AND logic, non-existent column
- Skip generated-fixture tests when bench data not present (CI compat)
- Extract ROW_GROUP_SIZE and BENCH_CATEGORIES constants
Scripts:
- Fix Avro manifest encoding (proper zigzag varints, correct map count)
- Fix O(n²) offset tracking → O(1) running fileOffset
- Add percentile bounds checking in bench.ts
- Parallelize Parquet seed uploads (concurrency limit 4)
- Add generated fixtures to .gitignore1 parent 4478cce commit d7c637b
7 files changed
Lines changed: 348 additions & 230 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
157 | 158 | | |
158 | | - | |
| 159 | + | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
179 | | - | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | | - | |
| 184 | + | |
| 185 | + | |
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
| |||
206 | 209 | | |
207 | 210 | | |
208 | 211 | | |
209 | | - | |
| 212 | + | |
210 | 213 | | |
211 | 214 | | |
212 | | - | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
366 | 370 | | |
367 | 371 | | |
368 | 372 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
375 | 398 | | |
376 | 399 | | |
377 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
19 | 37 | | |
20 | 38 | | |
21 | 39 | | |
| |||
126 | 144 | | |
127 | 145 | | |
128 | 146 | | |
129 | | - | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
133 | 151 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
139 | 160 | | |
140 | | - | |
| 161 | + | |
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
144 | 165 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
150 | 174 | | |
151 | 175 | | |
152 | 176 | | |
| |||
182 | 206 | | |
183 | 207 | | |
184 | 208 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
194 | 221 | | |
195 | 222 | | |
196 | 223 | | |
| |||
0 commit comments