Skip to content

Commit 05a0b49

Browse files
authored
fix: Update encrypted message doesn't work (#6548)
1 parent 3dceea3 commit 05a0b49

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

app/lib/encryption/room.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,7 @@ export default class EncryptionRoom {
407407
e2eMentions: getE2EEMentions(message.msg),
408408
content: {
409409
algorithm: 'rc.v1.aes-sha2' as const,
410-
ciphertext: await this.encryptText(
411-
EJSON.stringify({
412-
msg: message.msg
413-
})
414-
)
410+
ciphertext: msg
415411
}
416412
};
417413
} catch {

e2e/tests/assorted/01-e2eencryption.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,23 @@ describe('E2E Encryption', () => {
281281
await mockMessage(getMessage(5));
282282
await readMessages(4);
283283
});
284+
285+
it('should send a message, edit it and be able to read it', async () => {
286+
await mockMessage(getMessage(99));
287+
await element(by[textMatcher](getMessage(99)))
288+
.atIndex(0)
289+
.longPress();
290+
await waitFor(element(by.id('action-sheet')))
291+
.toExist()
292+
.withTimeout(2000);
293+
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
294+
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
295+
await sleep(300);
296+
await element(by[textMatcher]('Edit')).atIndex(0).tap();
297+
await element(by.id('message-composer-input')).replaceText(getMessage(6));
298+
await element(by.id('message-composer-send')).tap();
299+
await readMessages(5);
300+
});
284301
});
285302

286303
// describe('Login as UserA, accept new room key, send a message and read everything', () => {

0 commit comments

Comments
 (0)