Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3386611
D7437.id25184.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7437.id25184.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 5:19 AM (21 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597090
Default Alt Text
D7437.id25184.diff (1 KB)
Attached To
Mode
D7437: [keyserver] Fix `updateUserAvatar` query
Attached
Detach File
Event Timeline
Log In to Comment