Skip to content

Bound unread item query count - #18

Merged
Skulldorom merged 1 commit into
mainfrom
codex/add-upper-bound-to-n-query-and-update-tests
Jul 20, 2026
Merged

Bound unread item query count#18
Skulldorom merged 1 commit into
mainfrom
codex/add-upper-bound-to-n-query-and-update-tests

Conversation

@Skulldorom

Copy link
Copy Markdown
Owner

Motivation

  • Prevent dashboard integrations from requesting an unbounded number of items and ensure invalid values are rejected before contacting FreshRSS.
  • Make the valid n range explicit in the documentation for dashboard authors and operators.

Description

  • Add an upper bound to the n query parameter in freshrss_unread with Query(default=10, ge=1, le=100) in main.py.
  • Update README.md to document the valid n range as 1100 for the /freshrss/unread endpoint.
  • Add API-level tests in tests/test_main.py that use fastapi.testclient.TestClient to verify out-of-range values (0 and 101) return HTTP 422 without contacting FreshRSS and that boundary values (1 and 100) are accepted and forwarded.
  • Add httpx2 to the development dependency group in pyproject.toml to satisfy TestClient's transport requirement.

Testing

  • python -m py_compile main.py tests/test_main.py ran successfully and reported no syntax errors.
  • git diff --check was run and reported no issues.
  • uv run pytest attempted test collection but failed because starlette.testclient requires the httpx2 package; httpx2 was added to the dev dependencies, however installation could not be completed in this environment due to inability to fetch packages from PyPI, so pytest could not complete here.

Codex Task

@Skulldorom
Skulldorom merged commit fb50ddc into main Jul 20, 2026
2 checks passed
@Skulldorom
Skulldorom deleted the codex/add-upper-bound-to-n-query-and-update-tests branch July 20, 2026 09:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4b57ef9c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pyproject.toml

[dependency-groups]
dev = [
"httpx2>=2.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Regenerate the lockfile for the new test dependency

The checked workflow .github/workflows/docker.yml installs with uv sync --frozen before running pytest; uv sync --help defines --frozen as “Sync without updating the uv.lock file.” Because this commit does not add httpx2 to uv.lock, that install omits it, and the new from fastapi.testclient import TestClient fails during collection with Starlette's RuntimeError requiring httpx2. Update and commit uv.lock so the test job can run.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant