Repository navigation
feat: chat tab, Steam UID player profiles and paged recording list - #626
YetheSamartaka wants to merge 5 commits into
Conversation
YetheSamartaka
commented
Dec 1, 2026
- Chat tab in playback, with search, a filter per channel, and click-to-seek. The admin password in #login commands is masked on receipt, in the v1 download and in playback (#login ********), so recordings saved before this change are covered too.
- Player search and profiles across recordings, on a new /players page and under the recording search. A player is matched by Steam UID when the recording has one, otherwise by in-game name. Profiles list the other names a player used.
- Converted v1 recordings are indexed from their .json.gz, because the v1 protobuf has no UIDs. The JSON is streamed, so large recordings don't load whole into memory.
- The recording list is paged on the server. New query parameters: limit, offset, sort, dir, q, world, player, playerUid. The total comes in an X-Total-Count header, and there is a new GET /api/v1/operations/summary. Requests without limit still get every recording.
- Database migration 17 adds the operation_players table. Existing recordings are indexed once at startup.
- The side panel fits all tabs on one row in every locale.
- Tests: Go and UI tests pass at 100% coverage; typecheck and lint are clean.
- Chat tab in playback: search, per-channel filters and click to seek.
The admin password in a #login command is masked on receipt, in the
v1 export of stored recordings and in playback ("#login ********").
- Player search and profiles across recordings (/players). A player is
identified by Steam UID when the recording has one and by in-game name
otherwise; profiles list the other names a player used. Converted v1
recordings are indexed from their JSON source, which keeps the UIDs.
- The recording list is paged, filtered and sorted on the server
(limit, offset, sort, dir, q, world, player, playerUid) with an
X-Total-Count header, plus GET /api/v1/operations/summary. Requests
without limit still get every recording.
- The side panel is wide enough for all tabs on one row in every locale.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ratatoskr reviewed this pull request. Changes requested on Finished 2026-12-01 22:33 UTC. |
Coverage Report for ui
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Merging this branch will increase overall coverage
Coverage detailsCompared to commit d982b8a (run #46626337829)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files:
|
fank
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES — 6 blocking findings, including incomplete admin-password redaction.
Review details
- Previously stored recordings can still disclose the Arma admin password. handler.go:586–607 serves an existing v1 JSON copy unchanged; the redacting exporter only runs when the copy is missing. Native v2 saves write that copy by default, so the playback download still returns the original password if it was captured before masking. Also, masking in the browser does not sanitize the old manifest served by the asset handler. Make historical recording delivery safe server-side, including previously generated copies and cached variants, and pin the stored-copy case at the HTTP response boundary. The export unit test does not exercise that branch.
- Converting a v1 recording with chat makes the chat disappear in playback. streaming_converter.go:162–177 uses the generic parser, which stored
Sideas the message for my synthetic[2, "chat", "Moving up", "Nosey", "Side"]event. The v1 protobuf decoder then dropschatentirely. Carry the chat fields through conversion and decoding, and cover the converted playback path rather than just the JSON decoder. - A second name used in the same recording is neither searchable nor shown as an alias. worker.go:343–351 keeps only the first name per UID. In a recording with
NoseyandRavenon two entities sharing one UID, searching forRavenreturned no players and the profile had no aliases. Index all observed names without counting the recording twice. - The tag chip no longer selects the exact tag. RecordingSelector.tsx:112–118 sends the selected badge to the legacy substring filter. A
COOPselection returned bothCOOPandCOOP-training; the old UI matched onlyCOOP. Give the chips an exact-match filter without changing the existing API'stagsemantics. - A world offered by the summary can filter out its own recordings. operation.go:763–767 lowercases only the query values, while the stream's update path can store a mixed-case name. A stored
Altisappeared in the summary, but selectingAltisreturned no rows. Normalize both sides or migrate existing values as well as fixing writes. - Newest-first paging sorts supported RFC3339 dates as text. operation.go:89–94 sorts by the raw date string. With a one-row descending page,
2026-01-02T00:30:00+02:00came before2026-01-01T23:30:00Z, though it is one hour earlier. The old UI compared instants. Sort by normalized time before applying the page, retaining an ID tie-breaker.
Verification at 4edca58: GitHub Go, UI, and coverage-report checks passed. In a disposable checkout, go test -coverprofile=cover.raw -coverpkg=./cmd/...,./internal/... ./..., go run ./cmd/ocap-testkit run route-access playback-delivery conversion-recovery, UI build, npx --no-install tsc --noEmit, npx --no-install eslint src/, and npm run test:coverage passed. UI: 2,509 passed, 13 skipped. Separate synthetic Go checks reproduced findings 2–6; finding 1 is from tracing server delivery. No rendered browser check was performed.
Earlier discussions: GitHub GraphQL returned no review threads, so none were resolved, left open, or skipped.
- Mask #login passwords in recordings stored before masking: the v2 manifest with its precompressed sidecars and the v1 JSON copy or upload are rewritten in place before the server first serves any of them, and swept once at startup (chat_redaction_revision, migration 19). A recording that cannot be checked is not served. The response boundary is pinned for the stored copy, every manifest encoding and a sidecar asked for by name. - Carry chat through v1 conversion as JSON in the event message, masked, and decode it in the v1 protobuf decoder; the converted playback path is covered end to end. - Index every name a player used in a recording (operation_player_names) so each is searchable and listed as an alias without counting the recording twice. - Tag chips filter on a new exact tagExact parameter; tag keeps its contains semantics. - Lowercase world names when a streamed recording is saved, and fix the rows saved before (migration 18), so every summary world selects its recordings. - Sort dates by the instant they name (julianday), RFC3339 offsets included, for paging, profiles and player search. - Match #login after any Unicode whitespace or U+FEFF, the same set in the server, the UI and the addon (shared internal/redact package). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ratatoskr reviewed this pull request. Changes requested on Finished 2026-12-02 08:04 UTC. |
fank
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES — 8 blocking findings, including remaining admin-password exposure.
Review details
- Valid historical JSON can still disclose the Arma admin password.
redact_stored.go:99–108skips parsing when the raw JSON does not contain the literal wordlogin. Legacy upload accepts JSON from other writers, and an encoder can write letters as Unicode escapes without changing the decoded chat message. The redactor then marks the recording checked and the download still contains the original credential. Match decoded JSON strings rather than treating a raw-text miss as proof that the file is safe. Extend the registered-route regression test with a synthetic escaped command. - The revision can certify files that were never checked or were not fully rewritten.
redact_stored.go:44–55processes only the first existing JSON file, butGetDatacan serve either.json.gzor.json. When both exist, the plain copy can retain the password. Also,ReplaceArtifactreplaces the raw manifest before its sidecars. If that second step fails, the retry sees an already-masked manifest and skips the sidecars. The route can then serve the stale sidecar by name, outside negotiated freshness checks. Verify every served representation or remove derived variants before certifying completion. Test coexistence and a retry after partial replacement; the current HTTP test only covers a single JSON copy and a successful rewrite. - A replacement upload can publish unchecked bytes under the previous revision.
handler.go:533–542makes the uploaded JSON visible before resetting the database row. A concurrent download in that window sees the old completed revision inChatRedactor.Ensureand serves the new, unsanitized file. If the DB write fails, the mismatch persists. Sanitize the staged upload before publishing it, or bind the serve decision to the exact artifact generation checked. Cover replacement with an already-marked recording and a failed metadata write. - Deleted or replaced recordings can leave searchable aliases. An async job that read a recording before its deletion can finish after the deletion transaction.
ReplaceOperationPlayersinserts the child rows and commits even when its revision update matches zero operations.SearchPlayerscan then find a surviving UID by a name from the deleted recording that no longer appears in the profile. Require a live parent operation in the write transaction and test a stale job completing after deletion or replacement. - The same-recording alias fix still omits names recorded on connections.
worker.go:390–420uses connection names to infer UIDs but only adds names from units and Zeus slots. A player recorded asRavenon a unit andNoseyon a connection with the same UID is neither searchable asNoseynor shown with that alias. Add the connection name to the matched participant without creating another participation record or counting connect-only observers. - Player search and the profile disagree on the latest name when dates tie. Streamed recordings use date-only values.
SearchPlayerstakes the name from a bare column alongsideMAX(julianday(...)), while the profile breaks ties by operation ID. A synthetic same-day pair returnedOldin search andNewon the profile. Use the same deterministic latest-row order in both. - The recording list can duplicate or skip rows when a recording is added or deleted between pages.
operation.go:736–748uses a live offset, andRecordingSelector.tsx:137–146blindly appends. For descending IDs, after[4,3], inserting5makes offset 2 return[3,2]; deleting4instead skips2. Give the UI a stable page boundary or restart pagination when its snapshot is invalidated. Deduplication alone does not recover skipped rows. - Recording search lost Unicode case-insensitive matching. The old selector lowercased both sides;
operation.go:787–797now relies on SQLiteLIKE, which only folds ASCII by default. For example,évacno longer findsÉvacuation. Preserve Unicode case matching forqbefore counting and paging, and pin a non-ASCII fixture.
Earlier review: Rechecked the previous six findings at 3e6f82b. Conversion now preserves chat in newly converted v1 recordings; exact tag chips, mixed-case world filtering, and RFC3339 instant ordering are fixed. Same-UID units now retain both names without counting a recording twice, but connection aliases are still missing. Historical HTTP redaction is improved but incomplete (findings 1–3). GraphQL returned no review threads; none were resolved, left open, or skipped. The earlier findings were in the review body, not in resolvable threads.
Verification at 3e6f82b: GitHub Go, UI, and coverage-report checks passed. In a disposable checkout, go test -coverprofile=cover.raw -coverpkg=./cmd/...,./internal/... ./... passed (100% Go statement coverage); go run ./cmd/ocap-testkit run route-access playback-delivery conversion-recovery passed. UI npm run build, npx --no-install tsc --noEmit, npx --no-install eslint src/, and npm run test:coverage passed (2,514 passed, 13 skipped, 100% measured coverage). The redaction findings are from tracing server delivery and the write/retry paths; no live data or credentials were used. No rendered browser check was performed.
- Stored chat: match #login in decoded JSON, check both .json.gz and .json, and rewrite any sidecar that differs from its manifest, so a recording is only marked once every servable file is clean. - ReplaceArtifact removes sidecars before replacing the raw file, so a failure part way leaves none of the old bytes. - Uploads are masked before they are published; a non-JSON upload is refused. - Player index writes require a live operation, so a stale job after a delete or replace writes nothing. - Connection names join the matching participant as other names. - Player search and profile pick the latest name by the same order. - The recording list pages by cursor (after / X-Next-Cursor), so rows added or deleted between pages neither repeat nor skip. - q matches in any case of any script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ratatoskr reviewed this pull request. Changes requested on Finished 2026-12-02 20:08 UTC. |
fank
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES — 3 blocking findings, including admin-password exposure during upload.
Review details
- Viewers can still receive an unmasked Arma admin password while an upload is in progress.
StoreOperationwrites unredacted bytes to a fixed staging file inside the served data directory before masking them.chatRecordingdoes not recognize that staging file, andGetDataserves existing files even when they are not recognized recording artifacts. The fixed path also lets two uploads for the same recording share the file that one request already checked. Use a unique staging file per request in an area the viewer route cannot serve, then publish only that checked file. The current replacement test only requests the final filename after the upload returns; add a registered-route test that pauses before masking and verifies staging files cannot be fetched. - Historical redaction buffers the whole position history before serving playback.
maskJSONChatdecodes each top-level value into ajson.RawMessage, so the entireentitiesarray, including every position, gets buffered and copied even when there is no chat. In a disposable checkout, checking a clean synthetic 76.1 MiB recording allocated 332.1 MiB in total, with heap allocation still 268.1 MiB above baseline when the call returned.RedactStoredChatalso runs this scan for the JSON copy before the first request can receive that recording's v2 manifest. Large recordings can exhaust a memory-limited server during backfill or ordinary playback. Stream or skip non-chat values without buffering the whole array; cover a large clean recording as well as a rewrite. - A transient error loading the next page silently strands the rest of the recordings.
RecordingSelector.tsx:158–162setspageFailed, which disables further loading, but the list only renders a loading indicator, not an error or retry. The existing test leaves only 3 of 7 recordings visible until it changes the sort. Show an error and offer a retry of the same cursor so users can recover without changing their search or sort. Test a failed page followed by a successful retry.
Earlier reviews: Rechecked the first review and the follow-up at acd080f. Converted chat, exact tags, mixed-case worlds, RFC3339 instant ordering, same-recording and connection aliases, stale index writes, same-day name ties, cursor paging across inserts/deletes, and Unicode mission search are fixed. Historical escaped chat, both JSON copies, stale manifest sidecars, and the final filename after an isolated upload are covered; finding 1 is the remaining upload-delivery gap. GitHub GraphQL returned no unresolved review threads. None were resolved, left open, or skipped; the earlier findings are in the review bodies.
Verification: GitHub Go, UI, and coverage-report checks passed. In a disposable checkout with CGO enabled, go test -coverprofile=cover.raw -coverpkg=./cmd/...,./internal/... ./... passed (100% measured Go statement coverage). go run ./cmd/ocap-testkit run route-access legacy-upload playback-delivery conversion-recovery passed after installing the UI dependencies required by the playback case. UI npm run build, npx --no-install tsc --noEmit, npx --no-install eslint src/, and npm run test:coverage passed (2,517 passed, 13 skipped, 100% measured coverage). Finding 1 is from tracing the registered route and upload code, not a live-service test. No browser rendering was inspected.
…d page - Stage each upload in a random directory of its own under .upload-staging/ and publish only the masked file, by a rename. /data/ refuses the staging area under any name the disk resolves to it, and no recording may take its name, so a removal never reaches it. - /data/ refuses backslashes, and on Windows serves a file only by its stored name: no other case, 8.3 short name or stream suffix. The chat check matches names in any case and with the trailing dots and spaces Windows drops, so a recording named "Op." still plays. - A chat-bearing file of no recording is refused instead of masked through the requested name, which on a disk that ignores case could rename a stored recording. Recordings share a fixed set of locks, so requested names cannot grow it. - Check v1 JSON chat with a streaming scanner that holds one event at a time and accepts exactly what encoding/json does: a 30 MiB recording is checked with about 85 KiB allocated instead of 94 MiB. - Show an error with a retry of the same cursor when a page of the recording list fails to load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ratatoskr reviewed this pull request. Changes requested on Finished 2026-12-03 07:20 UTC. |
fank
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES — 2 blockers: unchecked manifest sidecars can leak passwords, and redaction can block otherwise playable recordings.
Review details
- A leftover manifest sidecar can still disclose the Arma admin password.
redactManifestChattreats a missingmanifest.pbas clean without checking its compressed copies.Ensurecan then mark the recording checked, andGetDataserves an existing sidecar by name. A partial restore that retains a precompressed historical manifest but not the raw file therefore leaves the old chat downloadable. Fail closed for a sidecar without a verified authoritative manifest, or sanitize the sidecar itself. Add a registered-route test for orphaned gzip and zstd copies; the existing failed-rewrite test still has a raw manifest. - A broken copy blocks playback of the intact format.
RedactStoredChatties the checks for the native manifest and the legacy JSON together. At the registered viewer route, a synthetic truncated legacy copy made a valid native manifest return 503; reversing the fixture made a valid legacy recording return 503 because of a damaged native manifest. That defeats the documented v1 fallback. Check the representation being served independently: keep unchecked bytes unavailable, but serve the intact, redacted format. Cover both directions at the route boundary.
Earlier reviews: Rechecked the three most recent blockers. The registered-route test now pauses two same-recording uploads in separate staging directories and confirms viewers cannot fetch them; the large-recording tests bound allocations for both a clean scan and a rewrite; and the recording-list tests verify retrying the same cursor. The fixes for converted chat, exact tags, world casing, RFC3339 sorting, aliases, stale index writes, latest-name ties, cursor paging, and Unicode search still hold. Historical escaped chat, both JSON filenames, and stale sidecars with a raw manifest present remain covered. GraphQL returned no review threads, so none were resolved, left open, or skipped; the earlier findings are in the submitted review bodies.
Verification at 134c7436: GitHub Go, UI, and coverage-report checks passed. In a disposable checkout, go test -coverprofile=cover-final.raw -coverpkg=./cmd/...,./internal/... ./... passed (100% measured Go statement coverage). go run ./cmd/ocap-testkit run route-access legacy-upload playback-delivery conversion-recovery passed. UI build, npx --no-install tsc --noEmit, npx --no-install eslint src/, and npm run test:coverage passed (2,519 passed, 13 skipped, 100% measured coverage). An additional synthetic route test reproduced both 503s in finding 2; finding 1 is from tracing server delivery. No native Windows or browser-rendered checks were run.
… copies - The manifest with its sidecars, the .json.gz and the .json are now checked and served separately. A damaged copy in one format returns 503 only for itself, and the other format still plays, masked. A recording is marked as checked once all three are clean. - A precompressed manifest left without its manifest.pb, as a partial restore can leave one, fails the check. It is never served by name or as an encoding, and it is left on disk. - A manifest whose version is neither 1 nor 2, such as one damaged at its start, fails the check instead of passing as converted. The sidecars of a converted manifest are now compared with it too. - A .json request is no longer answered with the .json.gz beside it as if that were its sidecar. Only the manifest's own sidecars stand in for it. - /data/ refuses manifest.* files other than the manifest and its sidecars, and files under the server's temporary names (.stream-*, .<file>.tmp*, and <name>.json.gz.tmp from older uploads), since no check reads them. - Route tests cover both damage directions, orphaned gzip and zstd sidecars, and each kind of unchecked copy. The testkit fixture is now ocap-local-v7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ratatoskr reviewed this pull request. Changes requested on Finished 2026-12-03 08:14 UTC. |
fank
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES — 2 blockers: an incomplete upload can overwrite a good recording, and playback does not use the intact copy.
Review details
- An incomplete gzip upload can replace a working recording.
maskJSONChatstops at the closing JSON brace;openRecordingJSONcloses the gzip reader without reading to EOF, so it can miss a truncated or invalid trailer. At the registered upload route, a synthetic replacement containing complete JSON but missing the gzip trailer returned 200 and overwrote the good file byte-for-byte with the corrupt upload. Reading the replacement through gzip returnedunexpected EOF. Validate through EOF before publishing the staged file, and pin that an invalid replacement returns 400 and preserves the existing file. - The intact JSON copy is downloadable, but the recording still fails to play.
loadRecording.ts:38–49chooses one format from the DB metadata. For a native v2 row, a manifest 503 ends playback without requesting the intact JSON copy. A focused loader test with a 503 from the manifest and a working JSON response confirmed this. The new route test proves the copy can be fetched directly, not the documented behavior that the other format stays playable. Fall back to the checked JSON copy on a protobuf load failure and test opening a recording whose metadata still says protobuf. Do not serve unchecked protobuf to make the fallback work.
Earlier discussions: Rechecked the previous review. Orphaned gzip and zstd manifest sidecars are now refused, and a damaged JSON copy no longer makes a good manifest return 503. The reverse direction is fixed at the asset route but not at playback (finding 2). The earlier staging, bounded chat scan, paging retry, converted chat, alias/index, and filtering fixes remain covered. GraphQL found no review threads; none were resolved, left open, or skipped. The earlier findings were in submitted review bodies.
Verification at 88e3dafe: GitHub Go, UI, and coverage-report checks passed. In a disposable copy, go test -coverprofile=cover.raw -coverpkg=./cmd/...,./internal/... ./... passed (100% measured statements), and go run ./cmd/ocap-testkit run route-access legacy-upload playback-delivery conversion-recovery passed. UI npm run build, npx --no-install tsc --noEmit, npx --no-install eslint src/, and npm run test:coverage passed (2,519 passed, 13 skipped, 100% measured coverage). Two additional isolated regression tests reproduced the findings above. No browser-rendered, native Windows, or native map-tool checks were run.