-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
awaiting-feedbackWaiting on further inputWaiting on further inputbugSomething isn't workingSomething isn't workingexternalAn issue raised by an external contributorAn issue raised by an external contributor
Description
Description
In src/domain/data/data_lifecycle_service.ts (lines 337-341), parseDuration() accepts zero values like "0h", "0d", "0w" which produce 0 milliseconds. The LifetimeSchema regex /^\d+(mo|y|h|m|d|w)$/ also matches these. Data configured with a zero lifetime expires immediately on creation.
Steps to Reproduce
- Create data with lifetime
"0h"— passes schema validation - The data expires immediately (expiration = creation time + 0ms)
- GC deletes the data on next scan
Expected Behavior
Zero durations should be rejected by the schema validation. The regex should require at least 1 for the numeric part.
Actual Behavior
"0h", "0m", "0d", "0w", "0mo", "0y" all pass validation and produce 0ms duration.
Summary
This affects duration parsing in the data lifecycle service. The fix would involve changing the regex to /^[1-9]\d*(mo|y|h|m|d|w)$/ or adding a post-parse check that the numeric value is > 0.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
awaiting-feedbackWaiting on further inputWaiting on further inputbugSomething isn't workingSomething isn't workingexternalAn issue raised by an external contributorAn issue raised by an external contributor