Page MenuHomePhabricator

[web] Fix issue with fetching messages after creating pending thread
ClosedPublic

Authored by jacek on May 20 2022, 4:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 6:40 PM
Unknown Object (File)
Mon, Nov 18, 12:51 AM
Unknown Object (File)
Wed, Nov 13, 7:25 PM
Unknown Object (File)
Wed, Nov 13, 7:24 PM
Unknown Object (File)
Wed, Nov 13, 7:24 PM
Unknown Object (File)
Wed, Nov 13, 7:24 PM
Unknown Object (File)
Mon, Nov 4, 3:22 PM
Unknown Object (File)
Sat, Nov 2, 7:01 PM

Details

Summary

Fixes the issue: https://linear.app/comm/issue/ENG-1170/after-creating-any-pending-threadsidebar-on-web-app-dont-fetch-any
There are two changes introduced in the diff:

  • remove pendingThread from navInfo in nav-reducer if activeChatThreadID is not pending
  • replace checking pendingThread with checking if current threadInfo is pending in chat-message-list.react.js

Each of these things should fix the original issue, but I think both of them should be introduced to prevent accidentally re-introducing the issue in the future

Test Plan

Follow steps described in Linear task. Messages should be always fetched from server

Diff Detail

Repository
rCOMM Comm
Branch
jacek/chat-fetch-issue
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Thanks for including the Linear link. It was helpful to see a description of the issue, a video of the issue, and a discussion of solutions. Made the diff easy to review.

web/redux/nav-reducer.js
39 ↗(On Diff #12977)

Doesn't really matter, but I wonder if switching these positionally

eg

if (state.pendingThread && !threadIsPending(state.activeChatThreadID) {

makes a tiny bit more sense?

Because it seems like if there's no state.pendingThread we can short-circuit and skip checking if the active chat thread id is pending?

Not that it makes any performance difference, but I think it's kind of like an "early return" in that you get the more critical condition "out of the way" first?

This revision is now accepted and ready to land.May 20 2022, 12:55 PM
web/redux/nav-reducer.js
39 ↗(On Diff #12977)

Oh yes, that makes sense.

change order in if statement