Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/libs/API/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {resolveDuplicationConflictAction, resolveEnableFeatureConflicts} from '@
import type {EnablePolicyFeatureCommand, RequestMatcher} from '@libs/actions/RequestConflictUtils';
import Log from '@libs/Log';
import {handleDeletedAccount, HandleUnusedOptimisticID, Logging, Pagination, Reauthentication, RecheckConnection, SaveResponseInOnyx} from '@libs/Middleware';
import {saveWorkspacesTabPathToSessionStorage} from '@libs/Navigation/helpers/lastVisitedTabPathUtils';
import {isOffline} from '@libs/Network/NetworkStore';
import {push as pushToSequentialQueue, waitForIdle as waitForSequentialQueueIdle} from '@libs/Network/SequentialQueue';
import Pusher from '@libs/Pusher';
Expand All @@ -15,7 +16,7 @@ import type OnyxRequest from '@src/types/onyx/Request';
import type {PaginatedRequest, PaginationConfig, RequestConflictResolver} from '@src/types/onyx/Request';
import type Response from '@src/types/onyx/Response';
import type {ApiCommand, ApiRequestCommandParameters, ApiRequestType, CommandOfType, ReadCommand, SideEffectRequestCommand, WriteCommand} from './types';
import {READ_COMMANDS} from './types';
import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS} from './types';

// Setup API middlewares. Each request made will pass through a series of middleware functions that will get called in sequence (each one passing the result of the previous to the next).
// Note: The ordering here is intentional as we want to Log, Recheck Connection, Reauthenticate, and Save the Response in Onyx. Errors thrown in one middleware will bubble to the next.
Expand Down Expand Up @@ -196,6 +197,9 @@ function makeRequestWithSideEffects<TCommand extends SideEffectRequestCommand>(
onyxData: OnyxData = {},
): Promise<void | Response> {
Log.info('[API] Called API makeRequestWithSideEffects', false, {command, ...apiCommandParameters});
if (command === SIDE_EFFECT_REQUEST_COMMANDS.DISCONNECT_AS_DELEGATE || command === SIDE_EFFECT_REQUEST_COMMANDS.CONNECT_AS_DELEGATE) {
saveWorkspacesTabPathToSessionStorage('/settings/workspaces');
}
const request = prepareRequest(command, CONST.API_REQUEST_TYPE.MAKE_REQUEST_WITH_SIDE_EFFECTS, apiCommandParameters, onyxData);

// Return a promise containing the response from HTTPS
Expand Down
Loading