diff --git a/app/actions/remote/entry/deferred.test.ts b/app/actions/remote/entry/deferred.test.ts index 69b173edf..3695d2861 100644 --- a/app/actions/remote/entry/deferred.test.ts +++ b/app/actions/remote/entry/deferred.test.ts @@ -8,6 +8,7 @@ import {act} from '@testing-library/react-native'; import {fetchMyChannelsForTeam, fetchMissingDirectChannelsInfo, type MyChannelsRequest} from '@actions/remote/channel'; import {fetchGroupsForMember} from '@actions/remote/groups'; import {fetchPostsForUnreadChannels} from '@actions/remote/post'; +import {fetchRoles} from '@actions/remote/role'; import {fetchScheduledPosts} from '@actions/remote/scheduled_post'; import {fetchTeamsThreads, updateCanJoinTeams, type MyTeamsRequest} from '@actions/remote/team'; import {autoUpdateTimezone, updateAllUsersSince, type MyUserRequest} from '@actions/remote/user'; @@ -18,6 +19,7 @@ import {processEntryModels, processEntryModelsForDeletion} from '@queries/server import {deferredAppEntryActions, restDeferredAppEntryActions, testExports} from './deferred'; jest.mock('@actions/remote/channel'); +jest.mock('@actions/remote/role'); jest.mock('@actions/remote/scheduled_post'); jest.mock('@actions/remote/team'); jest.mock('@actions/remote/user'); @@ -153,6 +155,7 @@ describe('actions/remote/entry/deferred', () => { expect(fetchPostsForUnreadChannels).toHaveBeenCalled(); expect(fetchGroupsForMember).toHaveBeenCalledWith(serverUrl, currentUserId, false, undefined); expect(fetchScheduledPosts).toHaveBeenCalledWith(serverUrl, initialTeamId, true, undefined); + expect(fetchRoles).toHaveBeenCalledWith(serverUrl, defaultTeamData.memberships, defaultChData.memberships, defaultMeData.user, false, true, undefined); }); it('should handle missing data gracefully', async () => { diff --git a/app/actions/remote/entry/deferred.ts b/app/actions/remote/entry/deferred.ts index 25694ff30..26d900952 100644 --- a/app/actions/remote/entry/deferred.ts +++ b/app/actions/remote/entry/deferred.ts @@ -116,7 +116,7 @@ export async function restDeferredAppEntryActions( const processFinalInitializationTasks = async (uniqueChannelsData: MyChannelsRequest) => { try { - fetchRoles(serverUrl, teamData.memberships, chData?.memberships, meData?.user, false, false, groupLabel); + fetchRoles(serverUrl, teamData.memberships, chData?.memberships, meData?.user, false, true, groupLabel); if (initialTeamId) { const initialTeam = teamMap.get(initialTeamId);