gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchf2-api-bugs26117255|||PR apps API: review comments on files with spaces in their namemref2-api-bugs/reports/R52-REPORT.md

3.0 KB

  1. # R52 report: app token "unknown" after a restart (branch r52, worktree ../gitoria-R52, commit b05f6d9; not merged, pushed or deployed)
  2. ## Mechanism: the gate's own token life, not gitoria and not mpackdb
  3. tests/status.mjs ran the server with GITORIA_APP_TOKEN_LIFE_MS=3000 (`const LIFE = 3000`), so tPub expired 3 seconds after it was issued. The gate reached the restart PUT 3.0 to 3.3 seconds after issuing tPub (stop about 1 s, cold start about 2 s), so it was a race against the clock. rowOfToken correctly answered "expired", which gives the 401. tests/status-keyed.mjs had the same race and was already fixed on 2026-11-02 (commit e874e44, LIFE 60000). The 2026-11-02 V37 finding came from that race. status.mjs was never changed the same way.
  4. ## Evidence (instrumented copy of the gate, 4 runs, deleted afterwards)
  5. After the SIGTERM stop and after the restart, sha256(tPub) was always in apptokens.mpack AND in apptokens.hash.txt. The row was stored and its unique index was on disk; nothing was lost or swept before the PUT.
  6. The PUT result followed the clock exactly: 200 at t+2983 ms; 401 at t+3098, 3169 and 3277 ms (LIFE 3000). That is 3 of 4 runs failing, the same rate Gitoria measured.
  7. ## Fix
  8. tests/status.mjs: LIFE = 60000, with a comment, the same shape as status-keyed. No .hl was changed, so no framework repro is needed and there is no DOCS gap. Expiry itself stays covered by tests/app-token.mjs (its own short life).
  9. ## Proof (LC_ALL=C, ports 8720-8739, `ss -ltn` checked free first)
  10. status.mjs 10 of 10 runs passed (61 checks, 0 failed each). status-keyed.mjs 10 of 10 runs passed (13 checks, 0 failed each).
  11. Gates, all 0 failed: check-theme 86 files and 0 problems; create-api 47; signin-return 3; browser 269; security 82; private 158; ident-access 30; apps 95; pull-numbers 48; pull-ssh 20; app-token 42; reviews 98; events 52; pr-page 61; status 61; limits 53; status-keyed 13; member-merge 82.
  12. The browser, signin, security, private and ida gates were moved into my range through GITORIA_GATE_*/…_PORT variables, as V52 did (script: ../gitoria-R52/.scratch/r52/gates.sh).
  13. ## Live impact
  14. None. Live sets no GITORIA_APP_TOKEN_LIFE_MS (not in docker-compose.yml, the Dockerfile or deploy.sh), so a token lives one hour. docker stop sends SIGTERM, the same signal as the gate's p.kill(), and the token row and its hash index survived that stop in every run. A deploy or restart therefore loses no tokens. A token older than one hour expires as the contract says, and the app trades its key for a new one.
  15. ## Risks
  16. Small. The gate no longer tests short expiry around a restart; app-token.mjs tests expiry without a restart.
  17. ## Steps and cleanup
  18. Steps (about 25 requests in all): reading the mission and docs about 5, probe 3, fix and runs 4, gates and commit about 10. I stopped everything I started: the probe, the loops and the gate script all ended on their own, nothing of mine listens on 8720-8739, and no Chrome has its cwd in gitoria-R52. No browser tabs were used, because this mission has no UI change. LOG.md and STATUS.md are untouched.

Branches

Latest commits

  • 26117255|||PR apps API: review comments on files with spaces in their namemre
  • b8796cecMerge branch 'f1-broken-json' into mainGitoria
  • 2f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre
  • f7c6ca07Merge branch 'ident-chooser-selector' into mainGitoria
  • 691abb8e|||PR tests: find ident identity choice without the removed .choose classmre
  • 16a3530fMerge branch 'heap-revert' into mainGitoria
  • 220a80e0|||PR Remove temporary /__heap route and heap helper; logmre
  • 13f0c342Merge branch 'hl25-records' into mainGitoria
  • a002ecb7|||PR records: HL25 report, heap helper, logmre
  • 2492a55cTemporary keyed /__heap route for the live memory snapshotmre
  • fefaedd2log: tracker PR-only, HL25 startedmre
  • 21aa57calog: parkmre
  • e9f950a8reports: G25c soakmre
  • a7783686log: deploy 9f41ffcmre
  • 9f41ffc1log: W30b mergedmre
  • bef635c1Merge branch 'w30b'mre
  • 15b996a5Org list: keyed rows by @id, newest first, concat instead of hand loopmre
  • c4f6d9e3reports: G25c growth huntmre
  • b88e39f1log: privacy cleanup donemre
  • bfd7826ddocs: neutral example organisation namemre