Skip to content

CSCEXAM-1716 Fixed library filter dropdowns - #1483

Merged
lupari merged 1 commit into
masterfrom
CSCEXAM-1716
Oct 26, 2026
Merged

lupari merged 1 commit into
masterfrom
CSCEXAM-1716

Conversation

@lupari

@lupari lupari commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

https://jira.eduuni.fi/browse/CSCEXAM-1716

Problem

The question library's filter dropdowns showed wrong or empty options, with no visible error.

Exam section dropdown (GET /app/sections): when a tag or question owner filter was already selected, the endpoint filtered ExamSection by paths that don't exist on it, examSectionQuestions.question.tags.id and questionOwners.id. Ebean emits unknown paths as raw SQL, so PostgreSQL failed with cross-database references are not implemented: examsectionquestions.question.tags.id (seen in production logs) or missing FROM-clause entry for table "questionowners". The 500 was swallowed by the frontend (no error handler on the subscribe), so the dropdown stayed empty or stale.
Repro: select a tag, then open the Exam section dropdown.

Tag dropdown (listTags$): section IDs were sent as examIds and exam IDs as sectionIds. The argument order was left behind when CSCEXAM-1210 reordered getQueryParams (2023). With an exam or section selected, the tag list was filtered by the wrong IDs.

Fix

  • Section filters now go through sectionQuestions.question (distinct already handles duplicate rows from the to-many joins).
  • listTags$ passes its IDs in the right order.

Tests

New controller tests for section filtering by tag, by owner, and by both. All three fail without the fix and pass with it. There are no frontend specs for LibraryService; the listTags$ change is a one-line argument reorder.

🤖 Generated with Claude Code

The question library filter dropdowns showed wrong or empty options:

- GET /app/sections filtered ExamSection by paths that do not exist on
  it, so Ebean emitted them as raw SQL: examSectionQuestions.question.
  tags.id -> PostgreSQL "cross-database references are not implemented"
  (seen in production logs), questionOwners.id -> "missing FROM-clause
  entry for table". The request returned 500 and the section dropdown
  silently stayed empty/stale. Both filters now go through
  sectionQuestions.question.
- listTags$ passed section ids as examIds and exam ids as sectionIds
  (argument order left behind in CSCEXAM-1210), so the tag dropdown was
  filtered by the wrong ids.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@lupari lupari changed the title CSCEXAM-1716 Fixed section tag and owner filters CSCEXAM-1716 Fixed library filter dropdowns Oct 19, 2026
@LofhJann
LofhJann self-requested a review October 26, 2026 10:30
@lupari
lupari merged commit 5f23036 into master Oct 26, 2026
6 checks passed
@lupari
lupari deleted the CSCEXAM-1716 branch October 26, 2026 12:05
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.

2 participants