Skip to content

fix: handle NoneType from redis.get in SingleTaskProgress.get#1402

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/single-task-progress-get-none
Open

fix: handle NoneType from redis.get in SingleTaskProgress.get#1402
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/single-task-progress-get-none

Conversation

@sentry

@sentry sentry Bot commented Jun 7, 2026

Copy link
Copy Markdown

This PR addresses the TypeError: the JSON object must be str, bytes or bytearray, not NoneType occurring in ddpui.celeryworkers.tasks.get_connection_catalog_task.

The root cause was identified in ddpui/utils/singletaskprogress.py, specifically in the SingleTaskProgress.get() method. When a Redis key associated with a task's progress expires, self.redis.get(self.task_key_) returns None. The subsequent call to json.loads(None) then raises the TypeError.

The fix involves adding a None check before calling json.loads. If redis.get() returns None, the get() method now returns an empty list []. This behavior is consistent with the initial state set in __init__ and aligns with the handling already present in the static fetch() method.

This change ensures that progress tracking can gracefully handle expired Redis keys without crashing, allowing add() and get() operations to proceed by effectively resetting the progress for an expired task.

Fixes DALGO-BACKEND-FV

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.

0 participants