Repository navigation
Commit dc61fba
fix(services): the DbJobAdapter class JSDoc stops promising a
The class-level "persisted side effects" list said `every execution writes a
sys_job_run row`. `wrap()` gates that insert on `recordRuns`:
current = { id: this.recordRuns ? await this.startRun(...) : undefined, ... };
and `settle()` only updates a row when one exists, so with `recordRuns: false`
no execution writes one. `tsup` emits this comment into the package's built
`index.d.ts`, which is the class-level editor tooltip an npm consumer reads —
the same "published documentation asserting behaviour the runtime does not
have" class as #9611, in the same file and the same emitted declaration.
The corrected bullet defers to `DbJobAdapterOptions.recordRuns` with `{@link}`
instead of restating the rule. Two true-but-divergent descriptions of one flag
is the next version of this defect, and the field's own JSDoc is where the
meaning belongs; the class list only says where it shows up. It also names the
one row the flag does not govern — `replay()`'s synthetic `trigger: 'replay'`
row, written either way, measured rather than assumed. Without that clause the
corrected sentence would be false today for exactly the reason #9633 records.
The fourth bullet was already true and gains the matching negative:
`bumpJob` is called from `settle` OUTSIDE the `if (run.id)` guard, so the
`sys_job` counters are updated whether or not a run row exists. Left implicit,
a reader carries the `recordRuns` caveat down onto it.
No behaviour change.
Five cases pin the flag, reusing this file's existing engine double rather
than minting a new one. Nothing in the package referenced `recordRuns` in any
direction before, so the wording corrected here and the field wording
corrected on #9611 were both accurate but unenforced. The discriminator
asserts the execution REALLY RAN — handler fired, `sys_job.run_count` bumped —
and that no row was written anyway; without that half, "0 rows" would also
pass for a job that never fired.
The replay case pins today's behaviour because that is what the JSDoc now
states, not as an endorsement: #9633 holds the open disposition, and if it
lands the case and the bullet it mirrors change together.
Co-authored-by: Claude <noreply@anthropic.com>sys_job_run row recordRuns: false never writes (#9631)1 parent 40162f1 commit dc61fba
3 files changed
Lines changed: 120 additions & 2 deletions
File tree
- .changeset
- packages/services/service-job/src
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| |||
0 commit comments