fix: pass yarn ready

pull/2660/head
William Grant 3 years ago
parent e5ecff7ec3
commit b6c3edbac4

@ -261,10 +261,10 @@ export class SessionConversation extends React.Component<Props, State> {
text={window.i18n('disappearingMessagesModeOutdated', [ text={window.i18n('disappearingMessagesModeOutdated', [
selectedConversation.hasOutdatedClient, selectedConversation.hasOutdatedClient,
])} ])}
dismissCallback={() => { dismissCallback={async () => {
const conversation = getConversationController().get(selectedConversation.id); const conversation = getConversationController().get(selectedConversation.id);
conversation.set({ hasOutdatedClient: undefined }); conversation.set({ hasOutdatedClient: undefined });
conversation.commit(); await conversation.commit();
}} }}
/> />
)} )}

@ -25,7 +25,9 @@ const ClosableOverlay = () => {
setShowNewDisppearingMessageModes(result); setShowNewDisppearingMessageModes(result);
}) })
.catch(() => { .catch(() => {
if (isCancelled) return; if (isCancelled) {
return;
}
}); });
return () => { return () => {

@ -679,7 +679,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
}); });
window.log.info( window.log.info(
`WIP: sendMessageJob() closedGroupVisibleMessage`, 'WIP: sendMessageJob() closedGroupVisibleMessage',
closedGroupVisibleMessage closedGroupVisibleMessage
); );
@ -1054,6 +1054,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
} }
} }
// tslint:disable: cyclomatic-complexity
public async updateExpireTimer({ public async updateExpireTimer({
providedExpirationType, providedExpirationType,
providedExpireTimer, providedExpireTimer,

@ -411,7 +411,11 @@ export async function innerHandleSwarmContentMessage(
if (expireUpdate && !isEmpty(expireUpdate)) { if (expireUpdate && !isEmpty(expireUpdate)) {
// TODO legacy messages support will be removed in a future release // TODO legacy messages support will be removed in a future release
checkHasOutdatedClient(conversationModelForUIUpdate, senderConversationModel, expireUpdate); await checkHasOutdatedClient(
conversationModelForUIUpdate,
senderConversationModel,
expireUpdate
);
} }
// TODO legacy messages support will be removed in a future release // TODO legacy messages support will be removed in a future release
@ -419,7 +423,7 @@ export async function innerHandleSwarmContentMessage(
expireUpdate?.isDisappearingMessagesV2Released && expireUpdate?.isDisappearingMessagesV2Released &&
expireUpdate?.isLegacyConversationSettingMessage expireUpdate?.isLegacyConversationSettingMessage
) { ) {
window.log.info(`WIP: The legacy message is an expiration timer update. Ignoring it.`); window.log.info('WIP: The legacy message is an expiration timer update. Ignoring it.');
return; return;
} }

@ -314,6 +314,7 @@ async function handleRegularMessage(
}); });
} }
// tslint:disable: max-func-body-length cyclomatic-complexity
export async function handleMessageJob( export async function handleMessageJob(
messageModel: MessageModel, messageModel: MessageModel,
conversation: ConversationModel, conversation: ConversationModel,
@ -352,7 +353,6 @@ export async function handleMessageJob(
} }
if (messageModel.isExpirationTimerUpdate()) { if (messageModel.isExpirationTimerUpdate()) {
// TODO legacy messages support will be removed in a future release
// NOTE if we turn off disappearing messages from a legacy client expirationTimerUpdate can be undefined but the flags value is correctly set // NOTE if we turn off disappearing messages from a legacy client expirationTimerUpdate can be undefined but the flags value is correctly set
const expirationTimerUpdate = messageModel.get('expirationTimerUpdate'); const expirationTimerUpdate = messageModel.get('expirationTimerUpdate');
if ( if (
@ -360,7 +360,7 @@ export async function handleMessageJob(
(!expirationTimerUpdate || isEmpty(expirationTimerUpdate)) (!expirationTimerUpdate || isEmpty(expirationTimerUpdate))
) { ) {
window.log.info( window.log.info(
`WIP: There is a problem with the expiration timer update`, 'WIP: There is a problem with the expiration timer update',
messageModel, messageModel,
expirationTimerUpdate expirationTimerUpdate
); );
@ -373,9 +373,10 @@ export async function handleMessageJob(
expirationTimerUpdate?.lastDisappearingMessageChangeTimestamp || getNowWithNetworkOffset(); expirationTimerUpdate?.lastDisappearingMessageChangeTimestamp || getNowWithNetworkOffset();
// Compare mode and timestamp // Compare mode and timestamp
const oldTypeValue = conversation.get('expirationType'); if (
const oldTimerValue = conversation.get('expireTimer'); isEqual(expirationType, conversation.get('expirationType')) &&
if (isEqual(expirationType, oldTypeValue) && isEqual(expireTimer, oldTimerValue)) { isEqual(expireTimer, conversation.get('expireTimer'))
) {
confirm?.(); confirm?.();
window?.log?.info( window?.log?.info(
'WIP: Dropping ExpireTimerUpdate message as we already have the same one set.' 'WIP: Dropping ExpireTimerUpdate message as we already have the same one set.'

@ -8,8 +8,4 @@ export abstract class DataMessage extends ExpirableMessage {
dataMessage: this.dataProto(), dataMessage: this.dataProto(),
}); });
} }
public dataProto(): SignalService.DataMessage {
return super.dataProto();
}
} }

@ -349,7 +349,7 @@ export const buildSyncMessage = (
if (expireUpdate && !isEmpty(expireUpdate)) { if (expireUpdate && !isEmpty(expireUpdate)) {
return buildSyncExpireTimerMessage(identifier, expireUpdate, timestamp, syncTarget); return buildSyncExpireTimerMessage(identifier, expireUpdate, timestamp, syncTarget);
} else { } else {
window.log.info(`WIP: Building Sync Expire Timer Message failed`, dataMessage, expireUpdate); window.log.info('WIP: Building Sync Expire Timer Message failed', dataMessage, expireUpdate);
} }
} }
return buildSyncVisibleMessage(identifier, dataMessage, timestamp, syncTarget); return buildSyncVisibleMessage(identifier, dataMessage, timestamp, syncTarget);

@ -320,7 +320,7 @@ export async function checkForExpireUpdate(
isDisappearingMessagesV2Released && isDisappearingMessagesV2Released &&
(isLegacyDataMessage || isLegacyConversationSettingMessage || shouldDisappearButIsntMessage) (isLegacyDataMessage || isLegacyConversationSettingMessage || shouldDisappearButIsntMessage)
) { ) {
window.log.info(`WIP: received a legacy disappearing message after v2 was released.`); window.log.info('WIP: received a legacy disappearing message after v2 was released.');
expirationType = convoToUpdate.get('expirationType'); expirationType = convoToUpdate.get('expirationType');
expirationTimer = convoToUpdate.get('expireTimer'); expirationTimer = convoToUpdate.get('expireTimer');
} }
@ -334,7 +334,7 @@ export async function checkForExpireUpdate(
isDisappearingMessagesV2Released, isDisappearingMessagesV2Released,
}; };
window.log.info(`WIP: checkForExpireUpdate`, expireUpdate); window.log.info('WIP: checkForExpireUpdate', expireUpdate);
return expireUpdate; return expireUpdate;
} }
@ -345,7 +345,7 @@ export function handleExpireUpdate(
messageModel: MessageModel, messageModel: MessageModel,
expireUpdate: DisappearingMessageUpdate expireUpdate: DisappearingMessageUpdate
) { ) {
let { const {
expirationType, expirationType,
// TODO renamed expireTimer to expirationTimer // TODO renamed expireTimer to expirationTimer
expirationTimer: expireTimer, expirationTimer: expireTimer,
@ -380,7 +380,7 @@ export function handleExpireUpdate(
return messageModel; return messageModel;
} }
export function checkHasOutdatedClient( export async function checkHasOutdatedClient(
convoToUpdate: ConversationModel, convoToUpdate: ConversationModel,
sender: ConversationModel, sender: ConversationModel,
expireUpdate: DisappearingMessageUpdate expireUpdate: DisappearingMessageUpdate
@ -401,13 +401,13 @@ export function checkHasOutdatedClient(
hasOutdatedClient: undefined, hasOutdatedClient: undefined,
}); });
} }
convoToUpdate.commit(); await convoToUpdate.commit();
} else { } else {
if (expireUpdate.isLegacyDataMessage || expireUpdate.isLegacyConversationSettingMessage) { if (expireUpdate.isLegacyDataMessage || expireUpdate.isLegacyConversationSettingMessage) {
convoToUpdate.set({ convoToUpdate.set({
hasOutdatedClient: outdatedSender, hasOutdatedClient: outdatedSender,
}); });
convoToUpdate.commit(); await convoToUpdate.commit();
} }
} }
} }

Loading…
Cancel
Save