Skip to content

Commit

Permalink
[lib] have edit entry message infos use e2ee op timestamp instead of …
Browse files Browse the repository at this point in the history
…creationTime

Summary:
Addresses out of order edit and create robotexts. I introduced a bug by setting the message info timestamp to the `creationTime` instead of the time the edit op was created.

This results in out of order robotext for creating and editing entries. The fix is to use the op creation timestamp instead of `creationTime` which is when the entry was created.

Test Plan: Tested on iOS simulator. entries are back in order.

Reviewers: ashoat, tomek, marcin

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D13361
  • Loading branch information
wyilio committed Sep 17, 2024
1 parent 3bee0f5 commit a4d4519
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/shared/dm-ops/edit-entry-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ import { dateFromString } from '../../utils/date-utils.js';
import { rawMessageInfoFromMessageData } from '../message-utils.js';

function createMessageDataFromDMOperation(dmOperation: DMEditEntryOperation) {
const { threadID, creatorID, creationTime, entryID, entryDate, text } =
dmOperation;
const { threadID, creatorID, time, entryID, entryDate, text } = dmOperation;
return {
type: messageTypes.EDIT_ENTRY,
threadID,
creatorID,
entryID,
time: creationTime,
time,
date: entryDate,
text,
};
Expand Down

0 comments on commit a4d4519

Please sign in to comment.