Skip to content

Dedup teacher-id lookups, drop dead repo guard#114

Merged
pambrose merged 2 commits into
masterfrom
fix-lows-batch-2
Jun 13, 2026
Merged

Dedup teacher-id lookups, drop dead repo guard#114
pambrose merged 2 commits into
masterfrom
fix-lows-batch-2

Conversation

@pambrose

Copy link
Copy Markdown
Contributor

Four low-severity cleanups.

  • Update to kotlin 1.6.10 #35 / 1.33.4 #43 Look up fetchClassTeacherId once per authorization check and reuse it for the comparison and the error message, instead of issuing the DB query twice on the unauthorized path (WsCommon, ClassSummaryPage, StudentSummaryPage).
  • 1.36.0 #45 Remove the unreachable repo getter guard and the unused defaultContentRoot sentinel (the guard could never fire); fix the misleading KDoc.
  • 1.35.0 #44 (partial) Read IS_TESTING with errorOnNonInit = false since it isn't part of initProperties() and the single global init guard can never meaningfully flag it. The full per-property guard rewrite is intentionally not done — it would break the test suite and production, and the finding notes no functional bug.

Behavior-preserving (fewer DB calls / dead-code removal / no value change); covered by the existing authz/content tests. Full suite green; lint + detekt clean.

🤖 Generated with Claude Code

- WsCommon/ClassSummaryPage/StudentSummaryPage: look up
  fetchClassTeacherId once per authorization check and reuse it for both
  the comparison and the error message, instead of issuing the DB query
  twice on the unauthorized path (#35, #43).
- LanguageGroup: remove the unreachable repo getter guard and the unused
  defaultContentRoot sentinel (the guard could never fire); fix the
  misleading KDoc (#45).
- ContentDsl: read IS_TESTING with errorOnNonInit=false since it is not
  part of initProperties() and the single global init guard can never
  meaningfully flag it (partial #44; the per-property guard rewrite is
  intentionally not done — it would break the test suite and production
  and the finding notes no functional bug).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...c/main/kotlin/com/readingbat/server/ws/WsCommon.kt 0.00% 4 Missing ⚠️
...in/kotlin/com/readingbat/pages/ClassSummaryPage.kt 0.00% 3 Missing ⚠️
.../kotlin/com/readingbat/pages/StudentSummaryPage.kt 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@pambrose pambrose merged commit 712f051 into master Jun 13, 2026
3 checks passed
@pambrose pambrose deleted the fix-lows-batch-2 branch June 13, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant