Address remaining low-severity code review findings (#31, #32, #34, #36, #38, #39, #41, #42, #44, #47, #48)#115
Merged
Merged
Conversation
#31 — extractJavaFunction: accept ChallengeName and guard the < 2 static declaration case with a named IllegalStateException instead of an opaque NoSuchElementException / IllegalArgumentException during content load. #47 — Add a quote-aware splitTopLevelCommas tokenizer and use it in both parseListElements and the pythonAdjust formatter so commas inside quoted list elements no longer split, and unquote both single and double quotes. #39 — Wrap the background content load in runInitialContentLoad, which catches and logs any failure (with stack trace) so a load exception no longer silently leaves the server permanently "not ready". #36 — Bound geoInfoMap with an LRU LinkedHashMap (MAX_GEO_CACHE_SIZE) and stop caching/persisting transient API failures: success persists + re-reads (cacheable), failure returns an un-persisted Unknown placeholder that is not cached, so failures retry instead of permanently poisoning the cache. Tests: JavaFunctionExtractTest, PythonListTokenizerTest, InitialContentLoadTest, GeoCacheBoundedTest (all run locally); GeoCacheTest rewritten for the new DB-backed failure semantics (CI-verified). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#32 — Replace the unbounded per-user answer-channel map with a fixed-size worker pool keyed by userDbmsId, so channels/coroutines stay bounded while each user's writes remain serialized. #34 — Catch InvalidRequestException in the four teacher-facing WS handlers and close with VIOLATED_POLICY via a shared WsCommon.rejectInvalidWsRequest helper, instead of a generic GOING_AWAY with no logged cause. #38 — Coalesce the request-logging session lookup, geo-id resolution, and insert into a single transaction (geo HTTP lookup stays outside it), cutting per-request pool checkouts from 3-4 to one. #41 — Extract PageUtils.wsHostRewriteJs() (applied to all six origin-rewrite sites) and summaryOnMessageJs(prefixField) (collapses the Class/Student summary onmessage loops), and fix the misaligned brace in StudentSummaryPage. #42 — Split displayStudentProgress into a data pass (EnrolleeProgress rows, answerHistoryBulk out of the render loop) and a pure render pass; extract answerCellColor/nameCellColor server-side color helpers. #44 — Track per-property initialization (setProperty records the name) and have the read guards check isInitialized() = global flag OR this property individually set. Strictly more permissive than the old global flag, so it never throws where the old guard didn't, while making the property-named error meaningful. The full per-property throwing guard remains declined as unsafe; the finding notes no functional bug. #48 — Log the failing contentSource.source (not $this) when DSL evaluation fails in evalContent. Also reconciles #36 with #38: server_requests.geo_ref is a non-nullable FK, so a failed geo lookup now persists a blank placeholder row (FK resolves) but is kept out of the in-memory cache, so it is not poisoned and retries later. Tests: UserAnswerQueueTest, PageUtilsWsTest, PropertyInitGuardTest (run locally); GeoCacheTest updated for the new DB-backed failure semantics (CI-verified). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add docs/CODE_REVIEW_JUNE_2026.md (the multi-agent review findings, now 48 of 48 addressed) and rename docs/CODE_REVIEW_SUGGESTIONS.md to docs/CODE_REVIEW_MARCH_2026.md. - OAuthSessionRotationTest: drop unused imports and redundant !! assertions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Addresses the remaining 11 open low-severity findings from the multi-agent code review (
docs/CODE_REVIEW_JUNE_2026.md), bringing it to 48 of 48 addressed.Findings fixed
Reliability / correctness
extractJavaFunction— acceptChallengeNameand guard the< 2 staticcase with a named error instead of an opaqueNoSuchElementException/IllegalArgumentExceptionduring content load.pythonAdjust/parseListElements— quote-awaresplitTopLevelCommastokenizer so commas inside quoted list elements no longer split; unquote both single and double quotes.runInitialContentLoad, which catches and logs failures (with stack trace) so a load exception no longer leaves the server permanently "not ready".evalContent— log the failingcontentSource.sourceinstead of$this.Resource / performance
geoInfoMap— bounded LRU cache (MAX_GEO_CACHE_SIZE); transient API failures persist a blank placeholder row (so theserver_requests.geo_refFK resolves) but are kept out of the in-memory cache so they retry instead of being permanently poisoned.ConcurrentHashMap<userId, Channel>with a fixed-size worker pool keyed byuserDbmsId, preserving per-user serialization.Error handling / design
VIOLATED_POLICY(sharedWsCommon.rejectInvalidWsRequest) instead of a genericGOING_AWAY, across all four teacher-facing handlers.PageUtils.wsHostRewriteJs()(6 origin-rewrite sites) andsummaryOnMessageJs()(Class/Student summary onmessage loops); fixed a misaligned brace.displayStudentProgressinto a data pass (EnrolleeProgress,answerHistoryBulkout of the render loop) and a pure render pass; extracted server-side color helpers.isInitialized()= global flag OR this property individually set (strictly more permissive than the old global flag). The full per-property throwing guard remains declined as unsafe; no functional bug.Tests
New Kotest specs run locally:
JavaFunctionExtractTest,PythonListTokenizerTest,InitialContentLoadTest,GeoCacheBoundedTest,UserAnswerQueueTest,PageUtilsWsTest,PropertyInitGuardTest. DB-backedGeoCacheTestupdated for the new failure semantics (verified on CI).Also: review-doc reorg (
CODE_REVIEW_SUGGESTIONS.md→CODE_REVIEW_MARCH_2026.md, findings →CODE_REVIEW_JUNE_2026.md) and anOAuthSessionRotationTesttidy.🤖 Generated with Claude Code