Page MenuHomePhorge

Add Room::localEcho and related test
ClosedPublic

Authored by nannanko on Aug 2 2024, 10:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 18, 1:56 PM
Unknown Object (File)
Fri, Sep 13, 2:58 AM
Unknown Object (File)
Thu, Sep 12, 11:14 PM
Unknown Object (File)
Thu, Sep 12, 3:06 PM
Unknown Object (File)
Tue, Sep 3, 8:00 PM
Unknown Object (File)
Mon, Sep 2, 4:12 PM
Unknown Object (File)
Mon, Sep 2, 3:44 PM
Unknown Object (File)
Sun, Aug 25, 8:39 AM
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
Branch
nannanko/stacked
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 237
Build 462: GitLab CI for libkazv
Build 461: arc lint + arc unit

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