Persist reaction.receivedAtDate

This commit is contained in:
Fedor Indutny 2023-12-08 02:30:20 +01:00 committed by GitHub
parent b2a3605d77
commit 47c49d0a20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 0 deletions

View file

@ -2397,6 +2397,7 @@ export async function startApp(): Promise<void> {
storyReactionMessage: message,
targetAuthorAci,
targetTimestamp: reaction.targetTimestamp,
receivedAtDate: data.receivedAtDate,
timestamp,
};
@ -2731,6 +2732,7 @@ export async function startApp(): Promise<void> {
storyReactionMessage: message,
targetAuthorAci,
targetTimestamp: reaction.targetTimestamp,
receivedAtDate: data.receivedAtDate,
timestamp,
};
drop(Reactions.onReaction(attributes));

View file

@ -28,6 +28,7 @@ export type ReactionAttributesType = {
targetAuthorAci: AciString;
targetTimestamp: number;
timestamp: number;
receivedAtDate: number;
};
const reactions = new Map<string, ReactionAttributesType>();

1
ts/model-types.d.ts vendored
View file

@ -110,6 +110,7 @@ export type MessageReactionType = {
fromId: string;
targetTimestamp: number;
timestamp: number;
receivedAtDate: undefined | number;
isSentByConversationId?: Record<string, boolean>;
};

View file

@ -2446,6 +2446,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
fromId: reaction.fromId,
targetTimestamp: reaction.targetTimestamp,
timestamp: reaction.timestamp,
receivedAtDate: reaction.receivedAtDate,
isSentByConversationId: isFromThisDevice
? zipObject(conversation.getMemberConversationIds(), repeat(false))
: undefined,

View file

@ -109,6 +109,7 @@ export async function enqueueReactionForSend({
storyReactionMessage,
targetAuthorAci,
targetTimestamp,
receivedAtDate: timestamp,
timestamp,
};

View file

@ -26,6 +26,7 @@ describe('reaction utilities', () => {
fromId: OUR_CONVO_ID,
targetTimestamp: Date.now(),
timestamp: Date.now(),
receivedAtDate: Date.now(),
...(isPending ? { isSentByConversationId: { [uuid()]: false } } : {}),
});

View file

@ -1606,6 +1606,7 @@ describe('both/state/ducks/conversations', () => {
emoji: '✨',
fromId: 'some-other-id',
timestamp: 2222,
receivedAtDate: 3333,
targetTimestamp: 1111,
},
],
@ -1636,6 +1637,7 @@ describe('both/state/ducks/conversations', () => {
emoji: '✨',
fromId: 'some-other-id',
timestamp: 2222,
receivedAtDate: 3333,
targetTimestamp: 1111,
},
],