Fix bugs and refactor unused QuizActor messages#113
Merged
Conversation
- BUG-1/2: Fix Maybe.map(async fn) anti-pattern in QuizActor (AddTeacher,
AddStudent, RemoveUser, Delete) and CurrentQuizActor (AddComment) — async
callbacks inside Maybe.map were fire-and-forget; DB writes and subscriber
notifications never completed
- BUG-3: Move JSON.parse inside try/catch in QuizActor Import handler to
prevent actor crash on malformed upload
- BUG-4: Add rehype-sanitize to markdown pipeline in useRendered.ts to close
XSS via dangerouslySetInnerHTML; KaTeX class/style attributes preserved
- BUG-5: Require API_KEYS env var at startup; remove hardcoded fallback key
- BUG-6: Replace arbitrary 500ms setTimeout for quiz state change with a
ref-gated effect that fires once quiz data has loaded
- BUG-7: Replace full-collection scan in UserStore.Find with a MongoDB query
- BUG-8: Guard quiz.teachers array access in Delete; use .includes() instead
of index 0 for owner check
- BUG-9: Roll back orphaned question in AddQuestion when target group is not
found
- BUG-10: Add .catch() to session-role update promise chain in UserStore
- IMP-1: Replace console.log/error/warn in UserStore and CurrentQuizActor
with structured logger calls or remove debug-only output
- IMP-7: Replace `any` filter type in unstallQuestionsInDb with Filter<Question>
- IMP-8: Fix error serialization in afterEntityWasCached (JSON.stringify on
Error produces {}; use e.stack instead)
https://claude.ai/code/session_017qKGaxUoFSuyp6zpKhhYda
These three QuizActorMessages were defined in models and handled in QuizActor but never called from the frontend. The frontend uses the generic Update message for all teacher/student list modifications. Dead code identified during codebase analysis. https://claude.ai/code/session_017qKGaxUoFSuyp6zpKhhYda
Fix bugs and refactor unused QuizActor messages
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.
No description provided.