MM-59271 Add DataLoader classes and batch loading missing users and statuses (#27804)

* Change addUserIdsForStatusAndProfileFetchingPoll to only ever receive arrays of user IDs

* Remove bufferCounter in favour of measuring array length

* Split addUserIdsForStatusAndProfileFetchingPoll into two separate actions

* Slightly simplify getPendingStatusesById

* Add DataLoaderInterval and use in actions/status_profile_polling

* Add tests for IntervalDataLoader

* Start adding DelayedDataLoader

* Updated DelayedDataLoader to split requested data into batches and made addIdsToLoad not return a promise by default

* Modify getMissingProfilesForIds to use a DataLoader and attach DataLoaders to the store

* Add tests for getMissingProfilesByIds loading statuses

* Revert change that defined getMissingProfilesByIds in a closure

* Change getMissingProfilesByUsernames to also use a DelayedDataLoader and add tests

* Pass extra argument into mocked version of Thunk

* Rename DataLoader.addIdsToLoad to DataLoader.queueForLoading

* Rename things and address feedback
Этот коммит содержится в:
Harrison Healey
2024-08-06 15:39:10 -04:00
коммит произвёл GitHub
родитель e1f0c8ee57
Коммит 56c84df916
12 изменённых файлов: 1119 добавлений и 201 удалений

Просмотреть файл

@@ -1,6 +1,7 @@
/.github/workflows/channels-ci.yml @mattermost/web-platform
/webapp/package.json @mattermost/web-platform
/webapp/channels/package.json @mattermost/web-platform
/webapp/channels/src/packages/mattermost-redux/src/store/configureStore.ts @hmhealey
/webapp/Makefile @mattermost/web-platform
/webapp/package-lock.json @mattermost/web-platform
/webapp/platform/*/package.json @mattermost/web-platform