Description
Summary
The workspace dormancy notification message displays incorrect timing information that doesn't align with the configured template settings, causing user confusion.
Environment
- Coder Version: 2.19.1
Issue Description
The dormancy notification message shows a "4 weeks" deletion timeframe instead of calculating the correct time based on the workspace template's dormancy settings, likely the 30 days calculated to 4 weeks.
Current Message:
Your workspace xxxx has been marked dormant because of inactivity exceeded the dormancy threshold.
Dormant workspaces are automatically deleted after 4 weeks from now of inactivity.
To prevent deletion, use your workspace with the link below.
Customer's Template Settings:
- Dormancy Threshold: 30 days
- Auto-delete After Dormancy: 90 days
Expected Behavior:
The notification should display "90 days" (or the configured auto-delete period) instead of "4 weeks".
Root Cause Analysis
Initial investigation suggests the issue may be related to the notification template using the wrong value instead of referencing the TimeTilDormantAutoDelete
setting from the workspace template configuration.
Relevant Code References:
- Migration file:
000232_update_dormancy_notification_template.up.sql
- Related PR: feat(coderd): notify when workspace is marked as dormant #13868
- Migration:
000311_improve_dormant_workspace_notification.up.sql
Impact
- User Experience: Misleading information causes confusion about actual deletion timeline
- Business Impact: Users may unnecessarily panic or take premature action based on incorrect timeframes
- Trust: Inaccurate system notifications reduce confidence in the platform
Steps to Reproduce
- Configure a workspace template with:
- Dormancy threshold: 30 days
- Auto-delete after dormancy: 90 days
- Let a workspace become dormant
- Observe the notification message received
- Note the discrepancy between "4 weeks" in message vs. 90 days in settings
Proposed Solution
Update the dormancy notification template to dynamically calculate and display the correct auto-deletion timeframe based on the workspace template's TimeTilDormantAutoDelete
setting.
Priority
Medium - While not system-breaking, this creates user confusion and trust issues with system notifications.
Additional Notes
- This issue may affect multiple customers using custom dormancy settings
- Verification needed on whether newer Coder versions have resolved this issue
- May go unnoticed when the same value applies to Dormancy and AutoDelete