Skip to content

handle 409 for pending deletion the same way as a 404#1238

Merged
mslynch merged 2 commits intopccfrom
pcc-pending-deletion
Oct 23, 2025
Merged

handle 409 for pending deletion the same way as a 404#1238
mslynch merged 2 commits intopccfrom
pcc-pending-deletion

Conversation

@mslynch
Copy link
Member

@mslynch mslynch commented Oct 22, 2025

When we delete a piece of content, there's a ~5 minute window where the content hasn't been fully deleted. When that's the case, we're not able to redeploy to it - we want to present the user the same prompt as when their app has been fully deleted.

Resolves #1236.

@mslynch mslynch changed the base branch from main to pcc-no-update-on-first-publish October 22, 2025 21:32
@mslynch mslynch changed the title pcc pending deletion handle 409 for pending deletion the same way as a 404 Oct 22, 2025
@mslynch mslynch marked this pull request as ready for review October 22, 2025 21:33
Copy link
Member

@rodriin rodriin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straight forward, treating it as a 404 error.

content <- withTokenRefreshRetry(PATCH_JSON, path, json)
content <- tryCatch(
withTokenRefreshRetry(PATCH_JSON, path, json),
rsconnect_http_409 = function(e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be err not e? Additionally, is it worth adding parent=err to the cli_abort()?

Copy link
Member Author

@mslynch mslynch Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something about this wasn't working right... But today I realized I can make the check sooner in getContent instead. Seems to be working fine with that change.

Copy link
Contributor

@karawoo karawoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about the wording but otherwise lgtm. Tried it locally and saw this which seems correct:

Image

Base automatically changed from pcc-no-update-on-first-publish to pcc October 23, 2025 20:21
@mslynch mslynch merged commit 3d0515b into pcc Oct 23, 2025
1 check passed
@mslynch mslynch deleted the pcc-pending-deletion branch October 23, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants