Skip to content

Pad not removed from backend workers after deletion #103

@cyclotruc

Description

@cyclotruc

Image

When a pad is deleted by a user via the DELETE /pad_id request, there's no logic to remove it from running workers, leading to those warnings in logs upon periodic save

See pad_router.py

@pad_router.delete("/{pad_id}")
async def delete_pad(
    pad_access: Tuple[Pad, UserSession] = Depends(require_pad_owner),
    session: AsyncSession = Depends(get_session)
) -> Dict[str, Any]:
    """Delete a pad (owner only)"""
    try:
        pad, _ = pad_access
        success = await pad.delete(session)
        if not success:
            raise HTTPException(
                status_code=500,
                detail="Failed to delete pad"
            )
        
        return {"success": True, "message": "Pad deleted successfully"}
    except Exception as e:
        raise HTTPException(
            status_code=500,
            detail=f"Failed to delete pad: {str(e)}"
        )

Since the worker can be on another thread/instance of the fastAPI process when running multiple upstreams, we need to find a way to tell the canvas worker that it should stop handling the deleted pad through redis

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions