#392 Docs disagree with the code in a dozen places (found while writing disclosures)
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#392
- issue
- state:closed
While writing the technical disclosures (#388) these places were found where the docs disagree with the code. The disclosures follow the code; the docs below still need fixing. - `docs/architecture.md:120` says saving is still a full rebuild and incremental index writes are future work. That contradicts the "Incremental saves" section of the same file (L46–59) and `server/incremental.mjs`. - `docs/architecture.md:57`: a patch changing more than half a timeline is rebuilt — but any patch of 64 changes or fewer is applied in place (`incremental.mjs:78-87`), so a rebuild needs size > max(64, count/2). - `docs/durations.md:46`, the OpenAPI text and a comment in `store.mjs` say PostgreSQL takes the first 10,001 durations in start order. The query (`store.mjs:2118-2126`) has `LIMIT 10001` with no `ORDER BY`, so it takes them in walk order (SQLite does keep start order). Decide whether to fix the query or the docs. - `docs/architecture.md:38`: `rasterize` applies "only after gestures". `navigate()` (`src/app.ts:4641`) also rounds when fitting a duration, jumping to a search result, opening a shared view link, on every zoom-animation frame and for follow-latest. - `docs/architecture.md:63` names `oc_overview`; the server calls `oc_overview_v2` (`oc_overview` is a wrapper). - `docs/architecture.md:69`: rebuild-saves compare the whole timeline "in one query"; the code pages through 20,000 keys at a time (`history.mjs:443-547`). - `docs/architecture.md:74`: a copy is prepared later at "20,000 events"; the code counts the source's own moment rows plus duration-tree rows, hidden rows included (`store.mjs:549-557`). - `docs/architecture.md:80`: history starts at the first save after the upgrade; the migration also starts it (`migrate.mjs:42`). - `docs/architecture.md:106`: resolution levels are exact powers of two; above ~8,192 px of drawable width the level is 1.5·span/1024 (`remote-cache.ts:160-166`). The last-drawn window also stays on screen whenever it overlaps the view, even without covering it (`remote-cache.ts:249-252`). - `docs/time-presentation.md:71`: two ruler labels crossfade; since #241 only the heaviest label is drawn (`ruler.ts:453-477`). - `docs/plugins.md:260`: "64 MiB" and "compiled once per process"; the code sets 64/16/16/4 MiB limits and remembers at most 1,000 results (`plugin-sandbox.mjs:20-27, 129-142`). - `docs/log-import.md` (~L110): batches grow to 5,000 entries; the importer caps them at 4,999 (`import-logs.mjs:258`). Code-only leftovers: - `durationLanes` is unused for drawing. - The `'size'` marker kind is in the type but rejected by validation. - `src/custom-time.ts:12` says no source text reaches the server runtime; the server compiles it but never runs it. Line numbers are as of `007091c`. https://github.com/openchronology/timeline-app/issues/392
Related
- #241 Ruler draws two labels on top of each other at each hour at an 8-hour view
- #388 patent troll defense via prior art
- #396 Docs match the code in a dozen places (#392)
- Docs match the code: saves, history, viewport cache, rulers, plugins, imports
- Merge pull request #396 from openchronology/docs/392-docs-match-code