Details
Details
- Reviewers
tomek ashoat - Commits
- rCOMMd1df2ad132f7: [keyserver] Remove holders in thread deleters
Enabled blob-hosted avatars for thin threads. Created a thread and set image avatar. Then deleted the thread. Looked into blob service logs to see that a blob was uploaded, then its holder was removed
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
keyserver/src/deleters/thread-deleters.js | ||
---|---|---|
103 ↗ | (On Diff #44666) | |
166–169 ↗ | (On Diff #44666) | Same concern as in https://phab.comm.dev/D13512?id=44665#inline-77250 |
keyserver/src/deleters/thread-deleters.js | ||
---|---|---|
87–92 ↗ | (On Diff #44666) | Before landing, please update to: const blobHolders = await fetchThreadBlobHoldersToDelete(threadIDs); await removeBlobHolders(blobHolders); const [{ threadInfos: serverThreadInfos }] = await Promise.all([ fetchServerThreadInfos({ threadIDs: new Set(threadIDs) }), rescindPushNotifs( SQL`n.thread IN (${threadIDs})`, SQL`IF(m.thread IN (${threadIDs}), NULL, m.thread)`, ), ]); const time = Date.now(); const updateDatas = []; for (const containedThreadID of threadIDs) { for (const memberInfo of serverThreadInfos[containedThreadID].members) { updateDatas.push({ type: updateTypes.DELETE_THREAD, userID: memberInfo.id, time, threadID: containedThreadID, }); } } const [{ viewerUpdates }] = await Promise.all([ createUpdates(updateDatas, { viewer, updatesForCurrentSession: 'return' }), deleteThreadsFromDB(threadIDs), ]); (We want to call removeBlobHolders before mutating anything, so that if it fails we don't end up in an inconsistent state.) |
166–169 ↗ | (On Diff #44666) | Before landing, please update to: await removeBlobHolders(blobHolders); await deleteThreadsFromDB(containerIDs); |