Skip to content

Commit e93cd1d

Browse files
authored
Raise crate deletion downloads limit to 1000/month (#12031)
1 parent 79f904b commit e93cd1d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

app/templates/crate/delete.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import LoadingSpinner from 'crates-io/components/loading-spinner';
4646
<li>
4747
<ol>
4848
<li>the crate only has a single owner, <em>and</em></li>
49-
<li>the crate has been downloaded less than 500 times for each month it has been published.</li>
49+
<li>the crate has been downloaded less than 1000 times for each month it has been published.</li>
5050
</ol>
5151
</li>
5252
</ol>

app/templates/policies/index.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import TextContent from 'crates-io/components/text-content';
9191
to a malicious user could have a significant impact for any existing users of your crate.</p>
9292

9393
<p>Crate owners can delete their crates under certain conditions: the crate has been published for less than 72
94-
hours, or the crate only has a single owner, the crate has been downloaded less than 500 times for each month it
94+
hours, or the crate only has a single owner, the crate has been downloaded less than 1000 times for each month it
9595
has been published, and the crate is not depended upon by any other crate on crates.io. If these conditions are
9696
not met, the crate will not be deleted. In exceptional cases crate owners may contact
9797
<a href='mailto:help@crates.io'>the crates.io team</a>

src/controllers/krate/delete.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use minijinja::context;
2222
use serde::Deserialize;
2323
use tracing::error;
2424

25-
const DOWNLOADS_PER_MONTH_LIMIT: u64 = 500;
25+
const DOWNLOADS_PER_MONTH_LIMIT: u64 = 1000;
2626
const AVAILABLE_AFTER: TimeDelta = TimeDelta::hours(24);
2727

2828
#[derive(Debug, Deserialize, FromRequestParts, utoipa::IntoParams)]
@@ -45,7 +45,7 @@ impl DeleteQueryParams {
4545
///
4646
/// The crate can only be deleted by the owner of the crate, and only if the
4747
/// crate has been published for less than 72 hours, or if the crate has a
48-
/// single owner, has been downloaded less than 500 times for each month it has
48+
/// single owner, has been downloaded less than 1000 times for each month it has
4949
/// been published, and is not depended upon by any other crate on crates.io.
5050
#[utoipa::path(
5151
delete,
@@ -467,7 +467,7 @@ mod tests {
467467

468468
let response = delete_crate(&user, "foo").await;
469469
assert_snapshot!(response.status(), @"422 Unprocessable Entity");
470-
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"only crates with less than 500 downloads per month can be deleted after 72 hours"}]}"#);
470+
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"only crates with less than 1000 downloads per month can be deleted after 72 hours"}]}"#);
471471

472472
assert_crate_exists(&anon, "foo", true).await;
473473

src/snapshots/crates_io__openapi__tests__openapi_snapshot-2.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,7 @@ expression: response.json()
20482048
},
20492049
"/api/v1/crates/{name}": {
20502050
"delete": {
2051-
"description": "The crate is immediately deleted from the database, and with a small delay\nfrom the git and sparse index, and the crate file storage.\n\nThe crate can only be deleted by the owner of the crate, and only if the\ncrate has been published for less than 72 hours, or if the crate has a\nsingle owner, has been downloaded less than 500 times for each month it has\nbeen published, and is not depended upon by any other crate on crates.io.",
2051+
"description": "The crate is immediately deleted from the database, and with a small delay\nfrom the git and sparse index, and the crate file storage.\n\nThe crate can only be deleted by the owner of the crate, and only if the\ncrate has been published for less than 72 hours, or if the crate has a\nsingle owner, has been downloaded less than 1000 times for each month it has\nbeen published, and is not depended upon by any other crate on crates.io.",
20522052
"operationId": "delete_crate",
20532053
"parameters": [
20542054
{

0 commit comments

Comments
 (0)