Skip to content

Fix Clearing Ticket Priority Back to None - #505

Open
SarkarShubhdeep wants to merge 2 commits into
mainfrom
fix/503-ticket-priority-none
Open

Fix Clearing Ticket Priority Back to None#505
SarkarShubhdeep wants to merge 2 commits into
mainfrom
fix/503-ticket-priority-none

Conversation

@SarkarShubhdeep

@SarkarShubhdeep SarkarShubhdeep commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #503: once a ticket priority is set (Low, High, etc.), it could not be cleared back to None — including after reload.

Cause: the UI sent an empty string / skipped the field, and the backend only allowed low | medium | high | critical, so the clear never persisted.

Changes:

  • Use a none sentinel in the priority Select (detail page + edit modal)
  • Backend $unsets priority when none is sent
  • Priority list filter includes None (tickets with no priority)

Test plan

  • Set a ticket priority to Low/High, then change it to None — confirm it sticks after reload
  • On Tickets list, filter Priority → None — only tickets with no priority show
  • Edit modal: clear priority via None and save

Made with Cursor

UI sent empty priority and the API rejected it; use a none sentinel
and unset the field so priority can be cleared and filtered.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings August 25, 2026 18:30
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

🚀 Preview Deployment Ready

Service URL
App https://mieweb-timehuddle-fix-503-ticket-priority-none.os.mieweb.org
API (Meteor) https://mieweb-timehuddle-fix-503-ticket-priority-none-api.os.mieweb.org

Preview auto-deletes when this PR is closed.

@SarkarShubhdeep SarkarShubhdeep added the bug Something isn't working label Aug 25, 2026
@SarkarShubhdeep SarkarShubhdeep self-assigned this Aug 25, 2026

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.

Pull request overview

Fixes priority clearing by using a none sentinel and removing the persisted priority.

Changes:

  • Adds None selection and filtering in ticket views.
  • Unsets priority in the Meteor backend.
  • Adds backend regression coverage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/features/tickets/TicketsPage.tsx Adds None filtering and editing.
src/features/tickets/TicketDetailPage.tsx Supports clearing priority with error handling.
meteor-backend/tests/tickets.test.ts Tests priority clearing.
meteor-backend/server/tickets.js Validates the sentinel and unsets priority.
meteor-backend/server/main.js Adds none to input schemas.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread meteor-backend/server/tickets.js Outdated
Comment on lines +139 to +143
status && priority && !clearPriority
? 'status-priority-changed'
: status
? 'status-changed'
: 'priority-changed';

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Will preserve 'none' in the activity payload and classify combined status + priority clears as status-priority-changed; DB will still $unset.

Activity feeds treat null as missing; log the none sentinel and
classify status+priority clears as a combined change. DB still unsets.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Dharp02

Dharp02 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Looks good !

@Dharp02
Dharp02 requested review from Dharp02 and horner September 1, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

Can’t set priority of tickets back to None after it’s changed to Low, High, and others.

4 participants