Page MenuHomePhorge

Add Room::localEcho and related test
ClosedPublic

Authored by nannanko on Aug 2 2024, 10:58 PM.
Tags
None
Referenced Files
F112400: D156.1732308357.diff
Thu, Nov 21, 12:45 PM
F112365: D156.1732303032.diff
Thu, Nov 21, 11:17 AM
F111960: D156.1732222352.diff
Wed, Nov 20, 12:52 PM
Subscribers
None

Details

Summary

This adds a function in Room to get a local echo in the room by its txn id.

Type: add

Test Plan

Verify tests pass.

Diff Detail

Repository
rL libkazv
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Please add a changelog type to the summary, using the following format:

Type: (add|remove|skip|security|fix)

tusooa requested changes to this revision.Aug 3 2024, 6:40 PM

add a test to verify it does not crash when the txn id is not found.

src/client/room/room.cpp
109

you must handle the case where find_if returns localEchoes.end(), which is an invalid iterator.

this MAY WELL happen if, in the process of cancelling, the message has already been sent.

your current implementation will cause undefined behaviour due to dereferencing the past-the-end iterator, which is invalid.

This revision now requires changes to proceed.Aug 3 2024, 6:40 PM

Handle the case where find_if returns localEchoes.end(), and update related test

This revision is now accepted and ready to land.Aug 6 2024, 6:17 PM