Page MenuHomePhabricator

D11989.diff
No OneTemporary

D11989.diff

diff --git a/keyserver/src/deleters/account-deleters.js b/keyserver/src/deleters/account-deleters.js
--- a/keyserver/src/deleters/account-deleters.js
+++ b/keyserver/src/deleters/account-deleters.js
@@ -63,7 +63,7 @@
DELETE u, i
FROM uploads u
LEFT JOIN ids i on i.id = u.id
- WHERE u.container = ${deletedUserID};
+ WHERE u.user_container = ${deletedUserID};
DELETE FROM relationships_undirected WHERE user1 = ${deletedUserID};
DELETE FROM relationships_undirected WHERE user2 = ${deletedUserID};
DELETE FROM relationships_directed WHERE user1 = ${deletedUserID};
diff --git a/keyserver/src/deleters/upload-deleters.js b/keyserver/src/deleters/upload-deleters.js
--- a/keyserver/src/deleters/upload-deleters.js
+++ b/keyserver/src/deleters/upload-deleters.js
@@ -11,7 +11,7 @@
}
const fetchQuery = SQL`
- SELECT uploader, container
+ SELECT uploader, container, user_container AS userContainer
FROM uploads
WHERE id = ${id}
`;
@@ -21,9 +21,13 @@
throw new ServerError('invalid_parameters');
}
const [row] = result;
- const { uploader, container } = row;
+ const { uploader, container, userContainer } = row;
- if (uploader.toString() !== viewer.userID || container !== null) {
+ if (
+ uploader.toString() !== viewer.userID ||
+ container !== null ||
+ userContainer !== null
+ ) {
throw new ServerError('invalid_parameters');
}
@@ -44,6 +48,7 @@
FROM uploads u
LEFT JOIN ids i ON i.id = u.id
WHERE u.container IS NULL
+ AND u.user_container IS NULL
AND creation_time < ${oldestUnassignedUploadToKeep}
`);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 2:20 AM (6 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2559377
Default Alt Text
D11989.diff (1 KB)

Event Timeline