fix(coderd): show correct deletion time in dormancy notification#26488
Open
zedkipp wants to merge 1 commit into
Open
fix(coderd): show correct deletion time in dormancy notification#26488zedkipp wants to merge 1 commit into
zedkipp wants to merge 1 commit into
Conversation
zedkipp
commented
Jun 17, 2026
The dormancy notification's "will be automatically deleted in X" sentence rendered the dormancy threshold instead of the auto-delete duration. A 30-day threshold rendered as "4 weeks" even when auto-delete was 90 days; a 60-day threshold rendered as "1 month" with a 7-day auto-delete. Render the countdown from the auto-delete setting, and skip the deletion sentence entirely when auto-delete is disabled so the notification no longer promises a deletion that will never happen.
7686a27 to
b03984c
Compare
Contributor
There was a problem hiding this comment.
Worth testing the new branch in workspaces_test.go?
| // Auto-delete must be configured for the body to render a | ||
| // deletion timeline. | ||
| if tmpl.TimeTilDormantAutoDelete > 0 { | ||
| deleteTime := dbtime.Now().Add(time.Duration(tmpl.TimeTilDormantAutoDelete)) |
Contributor
There was a problem hiding this comment.
Rather than generating the delete time with now + offset, we could use the updated DeletingAt returned from UpdateWorkspaceDormantDeletingAt via wsNew (mutating ws as we do with DormantAt). In practice this only saves us a very very minor data race between template updates and this loop and a bit of code duplication, so it isn't a big deal.
jscottmiller
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dormancy notification's "will be automatically deleted in X" sentence rendered the dormancy threshold instead of the auto-delete duration. A 30-day threshold rendered as "4 weeks" even when auto-delete was 90 days; a 60-day threshold rendered as "1 month" with a 7-day auto-delete. Render the countdown from the auto-delete setting, and skip the deletion sentence entirely when auto-delete is disabled so the notification no longer promises a deletion that will never happen.