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

    • Fixed issue date filtering so updated_at now matches against the correct update date field for both GET and POST inputs (including date-based filtering).
  • Tests

    • Added unit test coverage to ensure updated_at filtering targets the right date field, supports comma-separated and list-style parameters, honors optional prefixes, and treats empty filter values as a no-op.

@CLAassistant

CLAassistant commented Jun 26, 2026

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.
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: 02316e39-34d8-4b68-86da-b8dffa36509f

📥 Commits

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

📒 Files selected for processing (2)
  • apps/api/plane/tests/unit/utils/test_issue_filters.py
  • apps/api/plane/utils/issue_filters.py
🚧 Files skipped from review as they are similar to previous changes (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 both GET and non-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 both branches, 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 dates were gently turned;
No created_at in the trail tonight,
Just updated_at, all crisp and earned.
🐰✨

🚥 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 is concise and accurately reflects the core fix from created_at to updated_at.
Description check ✅ Passed The description has a detailed summary, test plan, and issue reference; the omitted template sections are non-critical.
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.

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
@sanjibani sanjibani force-pushed the fix/9316-updated-at-filter-uses-correct-column branch from c8c22ca to d2e8d10 Compare June 27, 2026 20:34
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