beardofedu / beardofedu/copilot-cli-fun-times

fix: filterByMinPriority excludes tasks that exactly match the threshold

Open Beginner friendly
#1 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

When calling `GET /tasks?minPriority=2`, tasks with priority exactly `2` are not returned. Only tasks with priority `3` appear.

## Steps to Reproduce

```bash
cd demo-app && npm start
# In another terminal:
curl 'http://localhost:3000/tasks?minPriority=2'
# Returns only priority-3 tasks — priority-2 tasks are missing
```

## Expected Behavior

Tasks with priority `>= 2` should be returned (inclusive threshold).

## Actual Behavior

Only tasks with priority `> 2` are returned (exclusive threshold).

## Root Cause

In `src/utils.js`, the `filterByMinPriority` function uses `>` instead of `>=`:

```js
// BUG — should be >=
return tasks.filter(task => task.priority > minPriority);
```

The failing test in `test/utils.test.js` describes the correct behavior.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/utils.js at filterByMinPriority, then read the related cases in test/utils.test.js. Run the test suite and reproduce the request from demo-app with minPriority=2. Done means priority-2 and priority-3 tasks are returned while lower-priority tasks remain excluded.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.