Dedup teacher-id lookups, drop dead repo guard#114
Merged
Conversation
- 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 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.
Four low-severity cleanups.
fetchClassTeacherIdonce 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).repogetter guard and the unuseddefaultContentRootsentinel (the guard could never fire); fix the misleading KDoc.IS_TESTINGwitherrorOnNonInit = falsesince it isn't part ofinitProperties()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