Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const DEPARTMENTS = {
"21G": "Global Studies and Languages",
"21H": "History",
"21L": "Literature",
"21M": "Music and Theater Arts",
"21M": "Music",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Renaming a department causes sanitizeFacets to silently drop filters from bookmarked URLs or saved sessions that use the old department name during a transitional period.
Severity: MEDIUM

Suggested Fix

To ensure backward compatibility during the transition, update sanitizeFacets to temporarily recognize the old department name "Music and Theater Arts" and map it to the correct department code. This will prevent saved states and bookmarks from silently failing until all dependent services are updated.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/constants.ts#L24

Potential issue: Renaming the department from "Music and Theater Arts" to "Music" in the
`DEPARTMENTS` constant creates a temporary backward compatibility issue. The
`sanitizeFacets` function uses a reverse map of this constant to validate department
filters. During the transition period before a dependent API library is updated, any
user with a bookmarked URL or saved session containing the old department name
(`?department=Music%20and%20Theater%20Arts`) will have their filter silently fail. The
function will not find the old name in its map and will drop the filter value, leading
to missing results without any warning to the user.

Did we get this right? 👍 / 👎 to inform future reviews.

@zawan-ila zawan-ila Jul 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yup. This is a very similar concern to mitodl/ocw-hugo-themes#1838 (comment). I am not sure if solving for this is worth it, I'll ask Peter if we care about this.

22: "Nuclear Science and Engineering",
24: "Linguistics and Philosophy",
CC: "Concourse",
Expand Down
Loading