Skip to content

fix: expose mock exam content readiness - #161

Merged
vinicius-ssantos merged 1 commit into
mainfrom
fix/mock-exam-content-readiness
Oct 8, 2026
Merged

vinicius-ssantos merged 1 commit into
mainfrom
fix/mock-exam-content-readiness

Conversation

@vinicius-ssantos

Copy link
Copy Markdown
Owner

Fixes the production path where a fresh CertForge installation offered a mock-exam action that could only fail with insufficient_mock_content.

What changes:

  • adds GET /api/study/mock-exams/availability;
  • reports readiness from the same per-topic eligibility rule used by the planner;
  • reports missing reviewed/published question counts per topic;
  • keeps an already-active mock resumable even if the currently-published bank later falls below the blueprint;
  • updates the learner track page, EN/PT-BR copy, OpenAPI contract/types, tests and changelog.

Validation completed locally:

  • full mvn verify on Java 25: 219 unit tests + 183 integration tests, 0 failures; Spotless and PMD passed
  • frontend: 181 tests passed
  • frontend typecheck/lint/API contract/build passed (one pre-existing hooks warning only)
  • git diff --check clean

Closes #138

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T17:11:54.400344Z a1a92de PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@vinicius-ssantos
vinicius-ssantos merged commit 19bef29 into main Oct 8, 2026
8 checks passed
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.

fix: a mock exam cannot be started on any installation our own tooling produces

1 participant