chore: batched code-review low findings (L1,L2,L4,L5,L6,L9)#123
Merged
Conversation
- L1: ExecuteQuery formats [16]byte as UUID only when the column type OID is uuid (pgtype.UUIDOID), not for any 16-byte value - L2: GetQueryHistory tail-reads the .jsonl backward in chunks for a positive limit instead of loading the whole file - L4: remove dead Wails-template App.css (#logo/.input-box/.result) + import - L5: centralize backend magic numbers (maxQueryRows, poolMaxConns, introspectTimeout, queryTimeout) and frontend resize clamps - L6: centralize localStorage keys into STORAGE_KEYS - L9: rewrite the 30s context-deadline error into a clearer message L3/L7 verified only (already addressed by the docs pass); L8 deferred. Closes #120
- Count only successfully-parsed entries toward `limit` so a corrupt trailing line no longer shrinks the result below `limit` while valid older entries remain (finding 1) - Parse each chunk's newly-completed lines incrementally instead of re-splitting the whole accumulated buffer every chunk (finding 2) Add TestGetQueryHistory_SkipsMalformedTail covering the regression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Batch of low-severity cleanups from the code review (issue #120). L8 (code-splitting CodeMirror) deferred; L3/L7 verified only (already handled by the docs pass).
ExecuteQueryformats a[16]bytevalue as a UUID only when the column'sDataTypeOID == pgtype.UUIDOID, so unrelated 16-byte values aren't misrenderedGetQueryHistorytail-reads the.jsonlbackward in 64 KiB chunks for a positivelimitinstead of loading the whole file (also drops the old 1 MB per-line scanner cap)frontend/src/App.css(#logo/.input-box/.result; app mounts on#root) and its importmaxQueryRows,poolMaxConns,introspectTimeout,queryTimeout— collapsing the 8× repeated10*time.Second) and the frontend resize clampslocalStoragekeys into aSTORAGE_KEYSobject"query exceeded the 30s timeout"at every exit point inExecuteQueryTests
TestQueryTimeoutError,TestExecuteQuery_UUIDFormatting_Integration,TestGetQueryHistory_TailOrder,TestGetQueryHistory_CrossesChunkBoundarygo test .+ integration (UUID test passed against the demo DB),go vetcleannpm run build(tsc clean), 438/438 vitest passingCloses #120