You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
segments renders NaN for a segment whose target_timerange has no start #147
Timerange.start / .duration and Segment.speed are all typed as required, but
the on-disk shape is looser: a segment can omit start — its 0 default is simply
not written — and speed is absent from some segments. formatTime(undefined)
then renders NaN, s + duration renders NaN, and s.speed !== 1 is true for undefined, so the speed column prints undefinedx:
ID Type Start -End Dur Spd Label
62a041c7 text NaN:00NaN-NaN:00NaN 3.00s undefinedx smoke-test
The same value reaches the JSON result as "start_us": null, so a caller that
does arithmetic on it gets NaN too.
Reproduction
Any project holding such a segment. It was measured on a real JianYing 9.0.0
(Windows) project that the app opens and edits normally — that capture is in
review as test/fixtures/jianying-9-0-0-windows/ (the smoke-test segment
carries {"duration":3000000} and no speed, while the smoke-cta-default
segment beside it carries both).
The read side. Both writers that could be reached in isolation write start:
add-text at start=0 writes target_timerange: {"start":0,"duration":…}
(verified twice, including in a fresh draft)
init seeds an empty draft, so it does not reintroduce a partial segment
so there is no reproducible writer to blame here, and a reader that tolerates the
shape fixes every table at once. The fields fall back to 0, 0 and 1, which
is what the app itself treats them as.
Proposed fix
Default the three values in segmentData — the single source for the segments
table, the JSON result and the text-only table. Test: delete start and speed
from the fixture, assert the -H output contains neither NaN nor undefined
and the JSON reports the defaults.
Thanks for catching this! Defaulting the missing fields on read makes sense, and #149 includes regression coverage for the reported failure. Keeping this open until that fix passes CI and lands.
Activity
renezander030 commentedon Oct 14, 2026
Thanks for catching this! Defaulting the missing fields on read makes sense, and #149 includes regression coverage for the reported failure. Keeping this open until that fix passes CI and lands.