Check if a message should be counted in replies count and generate appropriate updates.
https://linear.app/comm/issue/ENG-8892/handle-replies-count-as-a-part-of-dmoperationspecs
Depends on D12881
Paths
| Differential D12921 Authored by tomek on Jul 29 2024, 8:43 AM.
Details
Summary Check if a message should be counted in replies count and generate appropriate updates. https://linear.app/comm/issue/ENG-8892/handle-replies-count-as-a-part-of-dmoperationspecs Depends on D12881 Test Plan Just the Flow. Further testing will be performed after it is connected with the rest of the app.
Diff Detail
Event TimelineHerald added a subscriber: ashoat. · View Herald TranscriptJul 29 2024, 8:43 AM2024-07-29 08:43:35 (UTC-7) Harbormaster completed remote builds in B30763: Diff 42906.Jul 29 2024, 9:04 AM2024-07-29 09:04:10 (UTC-7) Comment Actions This is a little messy. Curious about @inka's suggestion. If there's some specific information needed from processDMOperation, I'd consider returning that explicitly, and handling it from the caller – it would improve readability, and simplify the logic in the specs Comment Actions Agree that it would be a lot better to extract the logic from the specs. I'm going to think about it more but at this point, it seems hard because:
There are some possible ideas, e.g.
Each of these could be complicated, and it seems they mostly move complexity from one place to another. Harbormaster failed remote builds in B30853: Diff 43020!Aug 1 2024, 6:30 AM2024-08-01 06:30:32 (UTC-7) Comment Actions Discussed something similar for updating unread status here.
This is true, but we could implement a utility that handles it. I don't think it would be that complicated.
Perhaps mergeUpdatesWithMessageInfos could be helpful here?
Ultimately my goal would be to unify the complexity in one place, so we can mitigate the risk of the programmer forgetting to handle it in a specific case, and so we could reduce code duplication. Comment Actions
Makes sense! Created https://linear.app/comm/issue/ENG-8930/unify-the-approach-to-replies-count-and-unread-status-updates to track. Harbormaster completed remote builds in B30862: Diff 43029.Aug 2 2024, 2:29 AM2024-08-02 02:29:25 (UTC-7) This revision is now accepted and ready to land.Aug 2 2024, 7:04 AM2024-08-02 07:04:56 (UTC-7) Closed by commit rCOMM31c1f9c89d3f: [lib] Handle replies count (authored by tomek). · Explain WhyAug 2 2024, 8:38 AM2024-08-02 08:38:09 (UTC-7) This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 42906 lib/shared/dm-ops/add-members-spec.js
lib/shared/dm-ops/change-thread-settings-spec.js
lib/shared/dm-ops/create-sidebar-spec.js
lib/shared/dm-ops/dm-op-utils.js
|
I introduced a previous diff where setAuxUserFIDs now clears fids prior to updating with new fids from the payload. The previous functionality of setAuxUserFIDs of just adding without clearing is now a new action type addAuxUserFIDs
There are now two callbacks which are called by a single useEffect. The two callbacks are called handleFarcasterMutuals and handleUserStoreFIDs