Skip to content

fix(api): filter "Updated At" by updated_at column, not created_at#9323

Open
sanjibani wants to merge 1 commit into
makeplane:previewfrom
sanjibani:fix/9316-updated-at-filter-uses-correct-column
Open

fix(api): filter "Updated At" by updated_at column, not created_at#9323
sanjibani wants to merge 1 commit into
makeplane:previewfrom
sanjibani:fix/9316-updated-at-filter-uses-correct-column

Conversation

@sanjibani

@sanjibani sanjibani commented Jun 26, 2026

Copy link
Copy Markdown

Summary

filter_updated_at in apps/api/plane/utils/issue_filters.py was passing created_at__date as the date_term to date_filter — a copy-paste from filter_created_at. The "Updated At -> is -> today" filter was therefore checking the issue's creation date instead of its last-modified date. Work items created earlier but updated today silently disappeared from the results.

The typo was in both the GET and POST branches of filter_updated_at. Replaced created_at__date with updated_at__date and added a focused unit test in apps/api/plane/tests/unit/utils/test_issue_filters.py that pins the column name.

Test plan

  • New unit test TestFilterUpdatedAt covers the GET, GET-with-CSV, POST, and prefixed-cycle_issue__ cases, asserting every emitted filter key references updated_at and none reference created_at.
  • Existing tests in tests/unit/utils/ continue to apply.

Refs #9316

Summary by CodeRabbit

  • Bug Fixes

    • Updated issue date filtering so updated_at searches now match the correct date field.
    • Improved filtering behavior for GET and POST requests, including comma-separated values, list-style inputs, optional prefixes, and empty filters.
  • Tests

    • Added coverage for updated date filtering to verify the correct field is used across supported input formats and edge cases.

filter_updated_at was passing `created_at__date` as the date_term to
date_filter, so the "Updated At -> is -> today" filter checked the
issue's creation date instead of its last-modified date. Work items
created earlier but updated today silently disappeared from the
results.

Fix the typo in both the GET and POST branches and add a focused
unit test that pins the column name.

Refs makeplane#9316
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


sanjibani seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c4d1500-8914-491f-8e7a-5681c87a7859

📥 Commits

Reviewing files that changed from the base of the PR and between 1e8f363 and c8c22ca.

📒 Files selected for processing (2)
  • apps/api/plane/tests/unit/utils/test_issue_filters.py
  • apps/api/plane/utils/issue_filters.py

📝 Walkthrough

Walkthrough

filter_updated_at now filters GET requests on updated_at__date instead of created_at__date. New unit tests cover GET and POST inputs, comma-separated and list date values, prefixes, and empty input behavior.

Changes

Updated-at filter fix

Layer / File(s) Summary
Filter target and regression coverage
apps/api/plane/utils/issue_filters.py, apps/api/plane/tests/unit/utils/test_issue_filters.py
filter_updated_at uses updated_at__date in the GET path, and new tests verify GET/POST handling, CSV/list inputs, prefix support, and no-op behavior for empty values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hopped by moonlit code,
And sniffed where updated dates მიდ?
No created_at in sight tonight,
Just updated_at, all clean and right.
🐰✨ The filter trail is fresh and bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely states the main bug fix: Updated At now filters by updated_at instead of created_at.
Description check ✅ Passed The description is detailed and covers the change, test plan, and reference, though it does not follow the exact template sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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