Limit retention api#1201
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds server-side validation for the retention field in the app update endpoint, enforcing a maximum of 63,113,903 (2 years) and a minimum of 0. Updates the English message for the retention-too-big error to reflect the new limit. No API signatures changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as put(c, appId, body, apikey)
participant Validator as Retention Validator
participant DB as Database
Client->>API: PUT /app/{id} with body.retention?
API->>Validator: Validate body.retention
alt retention >= 63113904
Validator-->>API: 400 { code: retention_to_big, message, value }
API-->>Client: 400 Bad Request
else retention < 0
Validator-->>API: 400 { code: retention_to_small, message, value }
API-->>Client: 400 Bad Request
else valid or undefined
API->>DB: Update app (retention if provided)
DB-->>API: Update result
API-->>Client: 200 OK (updated app)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
🧹 Preview Environment Cleaned Up The preview environment for this PR has been successfully removed from Cloudflare. Deleted:
|



Summary by CodeRabbit
Bug Fixes
Localization