Description
When performing a "Multi edit" bulk action on several devices via the web UI, the generated in-app notification summary (listing all affected MAC addresses) can exceed the 1024-character limit enforced by the CreateNotificationRequest Pydantic model. Instead of being truncated, the write is rejected with a validation error and the notification is silently dropped — the underlying device edit itself succeeds, but no record of the bulk action appears in the notification/message center.
Steps to reproduce
- Select enough devices (roughly 15+, depending on MAC/name length) in the Devices view.
- Perform a "Multi edit" action (e.g. bulk update a field) on all of them at once.
- Check the application logs.
Observed log output
[Validation] Error for write_notification: 1 validation error for CreateNotificationRequest
content
String should have at most 1024 characters [type=string_too_long, input_value='[Multi edit] Executed "u...3:02,9c:8d:7c:30:fc:0d"', input_type=str]
For further information visit https://errors.pydantic.dev/2.13/v/string_too_long
This occurred twice within a couple of minutes of each other while doing two separate bulk multi-edit actions.
Expected behavior
The notification content should be truncated (e.g. to 1024 chars, with an ellipsis or a summary like "and N more devices") instead of being rejected outright and lost. A failed multi-edit summary notification means there's no audit trail of what was changed in bulk.
Environment
- Image:
ghcr.io/netalertx/netalertx:latest (digest sha256:0ee5cdcaa8a84bfd2f31354b4b30e603804d124821055b9942dcffb52d2ce4bc, pulled ~2 weeks before report)
- Deployment: Docker (docker compose), Ubuntu host
Suggested fix
Truncate the content field server-side before constructing CreateNotificationRequest (or raise the max_length for this specific notification type / summarize instead of listing every MAC individually) rather than letting Pydantic validation reject the whole write.
Description
When performing a "Multi edit" bulk action on several devices via the web UI, the generated in-app notification summary (listing all affected MAC addresses) can exceed the 1024-character limit enforced by the
CreateNotificationRequestPydantic model. Instead of being truncated, the write is rejected with a validation error and the notification is silently dropped — the underlying device edit itself succeeds, but no record of the bulk action appears in the notification/message center.Steps to reproduce
Observed log output
This occurred twice within a couple of minutes of each other while doing two separate bulk multi-edit actions.
Expected behavior
The notification content should be truncated (e.g. to 1024 chars, with an ellipsis or a summary like "and N more devices") instead of being rejected outright and lost. A failed multi-edit summary notification means there's no audit trail of what was changed in bulk.
Environment
ghcr.io/netalertx/netalertx:latest(digestsha256:0ee5cdcaa8a84bfd2f31354b4b30e603804d124821055b9942dcffb52d2ce4bc, pulled ~2 weeks before report)Suggested fix
Truncate the
contentfield server-side before constructingCreateNotificationRequest(or raise themax_lengthfor this specific notification type / summarize instead of listing every MAC individually) rather than letting Pydantic validation reject the whole write.