The diff introduces fetching missing data using fetchSingleMostRecentMessages action for a thread that user is not member of.
Details
After the change, user that is not member of some subchannel should see preview message for this subchannel in subchannels list for parent thread.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
web/modals/threads/subchannels/subchannels-modal.react.js | ||
---|---|---|
62–90 ↗ | (On Diff #10961) | It looks like this logic is invalid:
So basically, we watch for threads that do not have messages and fetch messages for them, but when the messages are there, we unwatch the threads. The solution to this would be to find a different condition by which we choose which threads should be included in threadIDsWithNoMessages |
79–82 ↗ | (On Diff #10961) | It's not related to this diff, but we could do something similar for threads in which the most recent message is more than 2 weeks old. Currently we show no messages in that case. |
web/modals/threads/subchannels/subchannels-modal.react.js | ||
---|---|---|
62–90 ↗ | (On Diff #10961) | You're absolutely right. Sorry for missing it |
web/modals/threads/subchannels/subchannels-modal.react.js | ||
---|---|---|
79–82 ↗ | (On Diff #10961) | I don't think if it's necessary here, as we fetch max. n messages for n (missing in chat list) threads. I think, it won't affect performance much, but the user experience will be worse. |
web/modals/threads/subchannels/subchannels-modal.react.js | ||
---|---|---|
56 ↗ | (On Diff #11010) | |
56 ↗ | (On Diff #11010) | This should be defined closer to its usage (effect) |
75–83 ↗ | (On Diff #11010) | Should we also check if these are in subchannelsIDsNotInChatList? |
75–87 ↗ | (On Diff #11010) | Move these closer to their usage |
79–82 ↗ | (On Diff #10961) | Right, it is not necessary here. I was suggesting a fix for the current state where on login we only fetch recent messages and display no messages on thread list where the most recent message is old enough. We could dispatch this action for them after the login is successful. (This is not related to this diff) |
web/modals/threads/subchannels/subchannels-modal.react.js | ||
---|---|---|
75–83 ↗ | (On Diff #11010) | I don't think we should do it. In my opinion, we should try to fetch a single message from all threads that don't contain any. If we had a thread in our chat list, but we wouldn't have any message from it (e.g. because all had been sent more than 14 days before), we should probably try to fetch one instead of displaying No messages. |
web/modals/threads/subchannels/subchannels-modal.react.js | ||
---|---|---|
67–69 | Technically, this if is not needed, but let's keep it for readability |