Repository navigation
fix: expose mock exam content readiness - #161
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1a92de854
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| queryFn: () => unwrap(api.GET("/api/catalog/tracks/{slug}", { params: { path: { slug } } })), | ||
| }); | ||
| const mockAvailability = useQuery({ | ||
| queryKey: ["mock-exam-availability", slug], |
There was a problem hiding this comment.
Refresh availability after mock lifecycle changes
This learner-specific query inherits the 30-second staleTime from queryClient.ts, but neither starting nor finishing a mock invalidates or updates it. If a learner starts a mock and returns with browser Back during that window, the cached activeSessionId: null still renders “Start” rather than “Continue”; conversely, after continuing and quickly finishing an existing mock, the cached session ID sends them back to the closed run instead of offering a new mock. Update or invalidate ['mock-exam-availability', slug] when the lifecycle changes, or force this query to refetch on remount.
Useful? React with 👍 / 👎.
Fixes the production path where a fresh CertForge installation offered a mock-exam action that could only fail with
insufficient_mock_content.What changes:
GET /api/study/mock-exams/availability;Validation completed locally:
mvn verifyon Java 25: 219 unit tests + 183 integration tests, 0 failures; Spotless and PMD passedgit diff --checkcleanCloses #138