44655 backend [ My tasks ] Handle null values in /v3/tasks API - #276
Open
andrey-usov wants to merge 2 commits into
Open
44655 backend [ My tasks ] Handle null values in /v3/tasks API#276andrey-usov wants to merge 2 commits into
andrey-usov wants to merge 2 commits into
Conversation
Bring validated filter handling from the staging branch into master so legacy clients that send the string null get a clear 400 instead of an empty task list. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b48003c. Configure here.
…ter PR
Restore task.py from master so the null-filter fix does not remove select_related('workflow').
Co-authored-by: Cursor <cursoragent@cursor.com>
pneumojoseph
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
When a user opens their task list and no filters are actively selected, some clients send empty filter values as the literal string
null. The server treated those values as real filter criteria, which could return an empty task list even when the user had assigned tasks.Fix / Solution
GET /v3/tasksnow rejects the literal query-string valuenullfor filter parameters with a 400 validation error. Validation lives inTaskListFilterSerializer(including sharedRejectNullStringValidatorfor string fields).Related staging work: #256 (merged into
dev). This PR brings the same change cleanly ontomaster.Release notes
Fixed an issue where the task list could return no results when clients sent the literal string
nullfor filter parameters. The API now returns a clear 400 validation error instead.Changes
API
GET /v3/tasks— query parameterstemplate_id,template_task_api_name, andassigned_towith the literal valuenullnow return 400:template_id/assigned_to: "A valid integer is required."template_task_api_name: "This field may not be null."Web-client
No changes in this PR. Related frontend fix covered separately (clients should omit unset filters instead of sending
null).Test cases
API
GET /v3/tasks?template_id=nulldetails.name=template_idGET /v3/tasks?template_task_api_name=nulldetails.name=template_task_api_nameGET /v3/tasks?assigned_to=nulldetails.name=assigned_toGET /v3/tasks?template_id=null&template_task_api_name=nulldetails.name=template_idWeb-client
No changes.
Made with Cursor
Note
Reject literal string 'null' in
/v3/tasksfilter parametersRejectNullStringValidatorin validators.py, aBaseValidatorsubclass that fails validation when a field value is exactly the string'null', returning codenulland message'This field may not be null.'template_task_api_namefield inTaskListFilterSerializerso?template_task_api_name=nullreturns a 400 error.assigned_to,template_id) already reject'null'via their existing integer validation; new tests cover all three fields plus combined cases.Macroscope summarized 04c677c.