Skip to content

fix(student): address review feedback on time-slot error classification (main-v1 backport) - #1409

Open
JoelJosephPhilip wants to merge 1 commit into
vicharanashala:main-v1from
JoelJosephPhilip:fix/d10-timeslot-error-classification-followup-mainv1
Open

JoelJosephPhilip wants to merge 1 commit into
vicharanashala:main-v1from
JoelJosephPhilip:fix/d10-timeslot-error-classification-followup-mainv1

Conversation

@JoelJosephPhilip

Copy link
Copy Markdown
Collaborator

Summary

This is the main-v1 counterpart of the review-feedback follow-up on #1399 (the time-slot error banner fix). #1400 (the original main-v1 backport) had already merged before Meenakshi's review landed on #1399, so this is a separate follow-up PR rather than an update to an already-merged one.

Ports the same changes:

  • Extracts the ForbiddenError message-matching logic into classifyItemForbiddenError, a small pure function, so it can be unit tested directly.
  • Documents the exact backend message strings it matches against, including the archived-course and out-of-order-progression messages (confirmed NOT to match), and the "not enrolled" message, which is a known, deliberately unfixed gap (not really a time-slot issue, so not routed to the amber banner either).
  • Adds a console.warn fallback for any unrecognized ForbiddenError message.
  • Adds unit tests pinning all three real time-slot message variants, the two non-matching known messages, and a genuinely novel message.

Test plan

  • tsc --noEmit: clean, 0 errors.
  • vitest run: 32/32 passing (all frontend tests in the repo, including 6 new tests for classifyItemForbiddenError).

See the review discussion on #1399 for the full context: #1399 (comment) and #1399 (comment)

…on (main-v1 backport)

Same fix as the main-branch follow-up on vicharanashala#1399. Extracts the
ForbiddenError message-matching logic out of the inline regex into
classifyItemForbiddenError, a small pure function, so the
message-matching rules can be unit tested directly.

Also addresses the review points raised on vicharanashala#1399:
- Documents the exact backend message strings this matches against,
  including the two other known-but-not-time-slot messages (archived
  course version, out-of-order progression) and the "not enrolled"
  message, which is a known, deliberately unfixed gap: it isn't really
  a time-slot issue, so it isn't routed to the amber banner, but it's
  also not really "lesson locked" either.
- Adds a console.warn fallback for any ForbiddenError message that
  doesn't match a known pattern, so a future backend wording change
  surfaces in the console instead of silently falling back to the
  generic locked-lesson message.
- Adds unit tests pinning all three real time-slot message variants,
  confirming the archived-course and out-of-order-progression messages
  are correctly NOT classified as time-slot, and confirming a novel
  message is flagged as unrecognized.

The original main-v1 backport (vicharanashala#1400) already merged before this
review feedback came in, so this is a separate follow-up PR rather
than an update to that one.
Copilot AI lite review requested due to automatic review settings September 17, 2026 07:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the frontend Changes to the frontend of the project label Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes to the frontend of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants