fix: revert user_id filtering in task loaders to preserve backward compatibility
Avoid filtering loader queries by canonical user_id. Calling loaders with user_id=user_id introduces an exact-ID filter path that can drop valid legacy tasks: several loaders (e.g., load_due_market_trends_tasks) apply ...where task.user_id == user_id, but this commit also shifts discovery toward canonical IDs, so tasks persisted earlier with workspace-safe/sanitized IDs in the same per-user DB will no longer be returned and therefore never execute. Before this change, loaders were invoked as task_loader(db) and did not regress on mixed ID formats.
This commit is contained in:
@@ -700,14 +700,7 @@ class TaskScheduler:
|
||||
return summary
|
||||
|
||||
try:
|
||||
# Pass user_id for strict user isolation where loaders support it.
|
||||
# Keep backward compatibility with legacy loaders that only accept db.
|
||||
import inspect
|
||||
loader_signature = inspect.signature(task_loader)
|
||||
if "user_id" in loader_signature.parameters:
|
||||
tasks = task_loader(db, user_id=user_id)
|
||||
else:
|
||||
tasks = task_loader(db)
|
||||
tasks = task_loader(db)
|
||||
|
||||
if not tasks:
|
||||
return summary
|
||||
|
||||
Reference in New Issue
Block a user