Page MenuHomePhabricator

D7437.diff
No OneTemporary

D7437.diff

diff --git a/keyserver/src/updaters/account-updaters.js b/keyserver/src/updaters/account-updaters.js
--- a/keyserver/src/updaters/account-updaters.js
+++ b/keyserver/src/updaters/account-updaters.js
@@ -127,13 +127,25 @@
UPDATE uploads
SET container = NULL
WHERE uploader = ${viewer.userID}
- AND container = ${viewer.userID};
+ AND container = ${viewer.userID}
+ AND (
+ ${mediaID} IS NULL
+ OR EXISTS (
+ SELECT 1
+ FROM uploads
+ WHERE id = ${mediaID}
+ AND uploader = ${viewer.userID}
+ AND container IS NULL
+ AND thread IS NULL
+ )
+ );
UPDATE uploads
SET container = ${viewer.userID}
WHERE id = ${mediaID}
AND uploader = ${viewer.userID}
- AND container IS NULL;
+ AND container IS NULL
+ AND thread IS NULL;
UPDATE users
SET avatar = ${newAvatarValue}
@@ -146,6 +158,7 @@
WHERE id = ${mediaID}
AND uploader = ${viewer.userID}
AND container = ${viewer.userID}
+ AND thread IS NULL
)
);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 1:09 PM (9 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597090
Default Alt Text
D7437.diff (1 KB)

Event Timeline