Skip to content

Invalid UUID in remove_self causes 500 instead of proper validation error #5779

@ashnaaseth2325-oss

Description

@ashnaaseth2325-oss

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Description

The remove_self endpoint in ChannelUserViewSet does not validate channel_id as a UUID before querying the database.

If a malformed UUID is passed, it raises an unhandled exception leading to a 500 Internal Server Error.

Expected Behavior

The endpoint should validate channel_id as a UUID before querying and return a 400 Bad Request if invalid.

Current Behavior

Malformed UUID inputs trigger a 500 error due to implicit failure during query execution.

Proposed Fix

Explicitly validate channel_id using UUID parsing before performing the database lookup.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions