Page MenuHomePhabricator

[lib] Check the store when searching for message edits
ClosedPublic

Authored by tomek on Aug 20 2024, 7:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 25 2024, 3:08 PM
Unknown Object (File)
Sep 19 2024, 4:24 PM
Unknown Object (File)
Sep 19 2024, 4:01 PM
Unknown Object (File)
Sep 19 2024, 3:54 PM
Unknown Object (File)
Sep 19 2024, 3:47 PM
Unknown Object (File)
Sep 19 2024, 11:52 AM
Unknown Object (File)
Sep 12 2024, 10:09 PM
Unknown Object (File)
Sep 11 2024, 9:14 AM
Subscribers

Details

Summary

It can happen that when creating a thick sidebar, we don't yet have the source message persisted in the DB. In that case, we can try to find the message in Redux store.

https://linear.app/comm/issue/ENG-9034/creating-a-thick-sidebar-just-after-sending-a-message-doesnt-work

Depends on D13059

Test Plan

Checked if creating a sidebar immediately after sending a message works (before this diff the sidebar isn't created and an exception is thrown). Also checked if creating a message -> editing -> creating a sidebar works (with 10 edits).

const tid = uuid.v4();
await this.props.processDMOps({
  type: 'create_thread',
  threadID: tid,
  creatorID: viewerID,
  time: Date.now(),
  threadType: threadTypes.LOCAL,
  memberIDs: [],
  roleID: uuid.v4(),
  newMessageID: uuid.v4(),
});
const mid = uuid.v4();
await this.props.processDMOps({
  type: 'send_text_message',
  threadID: tid,
  creatorID: viewerID,
  time: Date.now(),
  messageID: mid,
  text: `${text}-parent`,
});
for (let i = 0; i < 10; i++) {
  await this.props.processDMOps({
    type: 'send_edit_message',
    threadID: tid,
    creatorID: viewerID,
    time: Date.now(),
    messageID: uuid.v4(),
    targetMessageID: mid,
    text: `${text}-${i}`,
  });
}
const sid = uuid.v4();
await this.props.processDMOps({
  type: 'create_sidebar',
  threadID: sid,
  creatorID: viewerID,
  time: Date.now(),
  parentThreadID: tid,
  memberIDs: [],
  sourceMessageID: mid,
  roleID: uuid.v4(),
  newSidebarSourceMessageID: uuid.v4(),
  newCreateSidebarMessageID: uuid.v4(),
});
await this.props.processDMOps({
  type: 'send_text_message',
  threadID: sid,
  creatorID: viewerID,
  time: Date.now(),
  messageID: uuid.v4(),
  text: `${text}-sidebar`,
});

Diff Detail

Repository
rCOMM Comm
Branch
dmops (branched from palys-swm/dmops)
Lint
No Lint Coverage
Unit
No Test Coverage