softAssert that messageId is always a UUID
This commit is contained in:
parent
465bdad2bf
commit
f9c2e9b0af
1 changed files with 4 additions and 1 deletions
|
@ -26,7 +26,7 @@ import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesD
|
|||
import * as Bytes from '../Bytes';
|
||||
import { CURRENT_SCHEMA_VERSION } from '../types/Message2';
|
||||
import { createBatcher } from '../util/batcher';
|
||||
import { assert, strictAssert } from '../util/assert';
|
||||
import { assert, softAssert, strictAssert } from '../util/assert';
|
||||
import { mapObjectWithSpec } from '../util/mapObjectWithSpec';
|
||||
import type { ObjectMappingSpecType } from '../util/mapObjectWithSpec';
|
||||
import { cleanDataForIpc } from './cleanDataForIpc';
|
||||
|
@ -38,6 +38,7 @@ import type { ProcessGroupCallRingRequestResult } from '../types/Calling';
|
|||
import type { RemoveAllConfiguration } from '../types/RemoveAllConfiguration';
|
||||
import createTaskWithTimeout from '../textsecure/TaskWithTimeout';
|
||||
import * as log from '../logging/log';
|
||||
import { isValidUuid } from '../types/UUID';
|
||||
|
||||
import type { StoredJob } from '../jobs/types';
|
||||
import { formatJobForInsert } from '../jobs/formatJobForInsert';
|
||||
|
@ -1169,6 +1170,8 @@ async function saveMessage(
|
|||
jobToInsert: options.jobToInsert && formatJobForInsert(options.jobToInsert),
|
||||
});
|
||||
|
||||
softAssert(isValidUuid(id), 'saveMessage: messageId is not a UUID');
|
||||
|
||||
expiringMessagesDeletionService.update();
|
||||
tapToViewMessagesDeletionService.update();
|
||||
|
||||
|
|
Loading…
Reference in a new issue