Add CallLinkDeleteManager to retry and ensure deletion

This commit is contained in:
ayumi-signal 2024-09-16 12:22:01 -07:00 committed by GitHub
parent 8b627b3f1a
commit a40d54099c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 229 additions and 89 deletions

View file

@ -100,9 +100,9 @@ import { addCallHistory, reloadCallHistory } from './callHistory';
import { saveDraftRecordingIfNeeded } from './composer';
import type { CallHistoryDetails } from '../../types/CallDisposition';
import type { StartCallData } from '../../components/ConfirmLeaveCallModal';
import { callLinksDeleteJobQueue } from '../../jobs/callLinksDeleteJobQueue';
import { getCallLinksByRoomId } from '../selectors/calling';
import { storageServiceUploadJob } from '../../services/storage';
import { CallLinkDeleteManager } from '../../jobs/CallLinkDeleteManager';
// State
@ -2031,7 +2031,8 @@ function deleteCallLink(
return async dispatch => {
await DataWriter.beginDeleteCallLink(roomId, { storageNeedsSync: true });
storageServiceUploadJob();
await callLinksDeleteJobQueue.add({ source: 'deleteCallLink' });
// Wait for storage service sync before finalizing delete
drop(CallLinkDeleteManager.addJob({ roomId }, { delay: 10000 }));
dispatch(handleCallLinkDelete({ roomId }));
};
}