fix(api): filter "Updated At" by updated_at column, not created_at - #9323
fix(api): filter "Updated At" by updated_at column, not created_at#9323sanjibani wants to merge 1 commit into
Conversation
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesUpdated-at filter fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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
c8c22ca to
d2e8d10
Compare
…eated_at (#9514) filter_updated_at() passed `created_at__date` as the date term in both its GET and POST branches, so filtering by "Updated At" actually filtered on the creation date. Work items updated today but created earlier never appeared under "Updated At -> is -> today", and the two filters returned identical result sets. Re-raise of community PR #9323 by @sanjibani, which is approved-ready but cannot merge because the CLA is unsigned. Original patch and tests carried over unchanged apart from the two fixes below; credit for the fix is theirs. Adjustments made while porting: - test_get_method_targets_updated_at_column asserted the exact key "updated_at__date", but date_filter's single-value branch appends a lookup suffix ("updated_at__date__contains"), so the assertion always failed. Match on the key prefix instead. - Added the missing trailing newline to the new test file. Verified on a local canary build: with one work item created 2020-01-01 but updated today, `?updated_at=2026-07-01;after` now returns 5 while `?created_at=2026-07-01;after` returns 4 — previously both returned 4. Unit tests pass (5); 4 of the 5 fail without the source change. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
filter_updated_atinapps/api/plane/utils/issue_filters.pywas passingcreated_at__dateas thedate_termtodate_filter— a copy-paste fromfilter_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. Replacedcreated_at__datewithupdated_at__dateand added a focused unit test inapps/api/plane/tests/unit/utils/test_issue_filters.pythat pins the column name.Test plan
TestFilterUpdatedAtcovers the GET, GET-with-CSV, POST, and prefixed-cycle_issue__cases, asserting every emitted filter key referencesupdated_atand none referencecreated_at.tests/unit/utils/continue to apply.Refs #9316
Summary by CodeRabbit
Bug Fixes
updated_atnow matches against the correct update date field for both GET and POST inputs (including date-based filtering).Tests
updated_atfiltering targets the right date field, supports comma-separated and list-style parameters, honors optional prefixes, and treats empty filter values as a no-op.