Skip to content

fix: prevent scheduled interview fetch failure by separating read and…#105

Open
harshitanagpal05 wants to merge 4 commits into
Team-NoxVeil:mainfrom
harshitanagpal05:fix/issue-86-interview-fetch
Open

fix: prevent scheduled interview fetch failure by separating read and…#105
harshitanagpal05 wants to merge 4 commits into
Team-NoxVeil:mainfrom
harshitanagpal05:fix/issue-86-interview-fetch

Conversation

@harshitanagpal05
Copy link
Copy Markdown

Description

This PR fixes issue #86 where GET /interviews/{interview_id} would fail for valid interviews after their scheduled times had passed.

Problem

The response schema was inadvertently applying create-time validation rules (future-date checks) to read operations, causing the endpoint to fail when fetching interviews with past scheduled times.

Solution

  • Added CustomInterviewReadResponse: A new read-only schema without the future-date validator
  • Updated the detail endpoint: Changed GET /interviews/{interview_id} to use CustomInterviewReadResponse instead of CustomInterviewResponse
  • Preserved creation constraints: Interview creation still validates:
    • start_time, end_time, submission_deadline must be in the future
    • dsa_score + dev_score == 100

Changes

  • interview.py - Added CustomInterviewReadResponse and refactored to use a base schema
  • interview.py - Updated the detail endpoint to use the read-only schema
  • README-issue-86.md - Documentation of the fix and validation steps

Testing

  • Files compile successfully with python -m compileall
  • Endpoint can now fetch expired interviews without validation errors
  • Create operations maintain all existing constraints

@sathwikshetty33
Copy link
Copy Markdown
Contributor

@harshitanagpal05 Thanks for the pr, but please review your agent generated code before raising a PR, it saves maintainers. Please drop all the changes to the non related files and just have a single commit with prefix backend/schema: and the related files only.

@harshitanagpal05 harshitanagpal05 force-pushed the fix/issue-86-interview-fetch branch 6 times, most recently from 9f53962 to 6895bdc Compare May 20, 2026 10:31
@harshitanagpal05 harshitanagpal05 force-pushed the fix/issue-86-interview-fetch branch from 6895bdc to 0c00924 Compare May 20, 2026 10:40
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