Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f92cfb7
Merge branch '@OlGierd03/jscodeshift_replacement_default_union_type_t…
OlGierd03 Jan 15, 2026
efdac06
Make UpdateMoneyRequestData type generic and replace default OnyxUpda…
OlGierd03 Jan 15, 2026
3f0abfb
Replace default union OnyxUpdate type in buildOnyxDataForMoneyRequest…
OlGierd03 Jan 15, 2026
6f4a23e
Prevent undefined in data arrays
OlGierd03 Jan 15, 2026
0bb6503
Create BuildOnyxDataForMoneyRequestKeys type to replace default union…
OlGierd03 Jan 15, 2026
d93b36f
Replace OnyxData generic argument OnyxKey with union of specific keys
OlGierd03 Jan 16, 2026
68f5706
Merge branch '@OlGierd03/jscodeshift_replacement_default_union_type_t…
OlGierd03 Jan 19, 2026
688db53
Replace OnyxData generic argument OnyxKey with union of specific keys…
OlGierd03 Jan 19, 2026
4f66388
Replace OnyxData generic argument OnyxKey with union of specific keys…
OlGierd03 Jan 19, 2026
c53f684
Replace OnyxData generic argument OnyxKey with union of specific keys…
OlGierd03 Jan 19, 2026
132082d
Replace OnyxData generic argument OnyxKey with union of specific keys…
OlGierd03 Jan 19, 2026
580fd46
Remove redundant OnyxData type variable
OlGierd03 Jan 19, 2026
c28689f
Replace OnyxData generic argument OnyxKey with union of specific keys…
OlGierd03 Jan 19, 2026
51f5180
Replace OnyxData generic argument OnyxKey with union of specific keys…
OlGierd03 Jan 19, 2026
019c83a
Merge branch 'main' into @OlGierd03/replace_default_union_OnyxUpdate_…
OlGierd03 Jan 20, 2026
6a6ef8a
Replace OnyxData generic argument OnyxKey with union of specific keys…
OlGierd03 Jan 20, 2026
fdf7a05
Remove all OnyxKey default arguments
blazejkustra Jan 20, 2026
b3b582a
Make types and functions generic to reduce the size of used OnyxUpdat…
OlGierd03 Jan 22, 2026
3fee43a
Reduce generic type nesting with general type alternatives in Request.ts
OlGierd03 Jan 23, 2026
05b9a6a
Improve generic types usage
OlGierd03 Jan 26, 2026
31d60be
Improve generic types usage
OlGierd03 Jan 26, 2026
f7bf8ca
Fix eslint check errors and limit code assertions
OlGierd03 Jan 26, 2026
4797450
Extract base type with shared generic logic
OlGierd03 Jan 27, 2026
a43ca9c
Merge 'main' branch and resolve conflicts
OlGierd03 Jan 27, 2026
d84b09a
Remove redundant OnyxData from Request types and fix spread syntax re…
OlGierd03 Jan 27, 2026
fab82e7
Rename types starting with 'Generic' to avoid confusion
OlGierd03 Jan 27, 2026
f8c5fe8
Add elementary jsdoc comments to new types
OlGierd03 Jan 27, 2026
dfb004f
Rename types starting with 'Generic' to avoid confusion
OlGierd03 Jan 28, 2026
111a4e4
Merge 'main' branch
OlGierd03 Jan 28, 2026
e9e3e7b
Improve new Base and Any type jsdoc comments
OlGierd03 Jan 28, 2026
a5e02c4
Improve generic types usage
OlGierd03 Jan 28, 2026
7770ca2
Improve jsdoc comments
OlGierd03 Jan 28, 2026
23d5156
Fix generic type usage in mock
OlGierd03 Jan 28, 2026
db3fb3e
Use OnyxData instead of props separately in buildOnyxDataForMoneyRequest
OlGierd03 Jan 28, 2026
ba0f692
Use OnyxData instead of props separately in buildOnyxDataForTrackExpense
OlGierd03 Jan 28, 2026
ded4815
Improve jsdoc comments
OlGierd03 Jan 29, 2026
2e058d2
Merge branch 'main' into @OlGierd03/replace_default_union_OnyxUpdate_…
OlGierd03 Jan 29, 2026
ea9ca33
Fix the typechecks after the main merge
OlGierd03 Jan 29, 2026
767bf99
Add comment explaining any usage
OlGierd03 Feb 3, 2026
2eca905
Merge branch 'main' into @OlGierd03/replace_default_union_OnyxUpdate_…
OlGierd03 Feb 3, 2026
5bc93f3
Adapt changes to the current main
OlGierd03 Feb 3, 2026
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
4 changes: 2 additions & 2 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,8 @@ type OnyxValuesMapping = {
[ONYXKEYS.DEVICE_ID]: string;
[ONYXKEYS.ACTIVATED_CARD_PIN]: string | undefined;
[ONYXKEYS.IS_SIDEBAR_LOADED]: boolean;
[ONYXKEYS.PERSISTED_REQUESTS]: OnyxTypes.Request[];
[ONYXKEYS.PERSISTED_ONGOING_REQUESTS]: OnyxTypes.Request;
[ONYXKEYS.PERSISTED_REQUESTS]: OnyxTypes.AnyRequest[];
[ONYXKEYS.PERSISTED_ONGOING_REQUESTS]: OnyxTypes.AnyRequest;
[ONYXKEYS.CURRENT_DATE]: string;
[ONYXKEYS.CREDENTIALS]: OnyxTypes.Credentials;
[ONYXKEYS.STASHED_CREDENTIALS]: OnyxTypes.Credentials;
Expand Down
88 changes: 50 additions & 38 deletions src/libs/API/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Onyx from 'react-native-onyx';
import type {OnyxKey} from 'react-native-onyx';
import type {SetRequired} from 'type-fest';
import {resolveDuplicationConflictAction, resolveEnableFeatureConflicts} from '@libs/actions/RequestConflictUtils';
import type {EnablePolicyFeatureCommand, RequestMatcher} from '@libs/actions/RequestConflictUtils';
import type {AnyRequestMatcher, EnablePolicyFeatureCommand} from '@libs/actions/RequestConflictUtils';
import Log from '@libs/Log';
import {handleDeletedAccount, HandleUnusedOptimisticID, Logging, Pagination, Reauthentication, RecheckConnection, SaveResponseInOnyx, SupportalPermission} from '@libs/Middleware';
import FraudMonitoring from '@libs/Middleware/FraudMonitoring';
Expand All @@ -13,7 +13,7 @@ import {addMiddleware, processWithMiddleware} from '@libs/Request';
import {getAll, getLength as getPersistedRequestsLength} from '@userActions/PersistedRequests';
import CONST from '@src/CONST';
import type OnyxRequest from '@src/types/onyx/Request';
import type {OnyxData, PaginatedRequest, PaginationConfig, RequestConflictResolver} from '@src/types/onyx/Request';
import type {AnyRequest, OnyxData, 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';
Expand Down Expand Up @@ -54,19 +54,19 @@ let requestIndex = 0;
/**
* Prepare the request to be sent. Bind data together with request metadata and apply optimistic Onyx data.
*/
function prepareRequest<TCommand extends ApiCommand>(
function prepareRequest<TCommand extends ApiCommand, TKey extends OnyxKey>(
command: TCommand,
type: ApiRequestType,
params: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey> = {},
conflictResolver: RequestConflictResolver = {},
): OnyxRequest {
onyxData: OnyxData<TKey> = {},
conflictResolver: RequestConflictResolver<TKey> = {},
): OnyxRequest<TKey> {
Log.info('[API] Preparing request', false, {command, type});

let shouldApplyOptimisticData = true;
if (conflictResolver?.checkAndFixConflictingRequest) {
const requests = getAll();
const {conflictAction} = conflictResolver.checkAndFixConflictingRequest(requests);
const {conflictAction} = conflictResolver.checkAndFixConflictingRequest(requests as Array<OnyxRequest<TKey>>);
shouldApplyOptimisticData = conflictAction.type !== 'noAction';
}

Expand Down Expand Up @@ -95,7 +95,7 @@ function prepareRequest<TCommand extends ApiCommand>(
};

// Assemble all request metadata (used by middlewares, and for persisted requests stored in Onyx)
const request: SetRequired<OnyxRequest, 'data'> = {
const request: SetRequired<OnyxRequest<TKey>, 'data'> = {
command,
data,
initiatedOffline: isOffline(),
Expand All @@ -118,7 +118,7 @@ function prepareRequest<TCommand extends ApiCommand>(
/**
* Process a prepared request according to its type.
*/
function processRequest(request: OnyxRequest, type: ApiRequestType): Promise<void | Response> {
function processRequest<TKey extends OnyxKey>(request: OnyxRequest<TKey>, type: ApiRequestType): Promise<void | Response<TKey>> {
Log.info('[API] Processing request', false, {command: request.command, type});
// Write commands can be saved and retried, so push it to the SequentialQueue
if (type === CONST.API_REQUEST_TYPE.WRITE) {
Expand All @@ -143,13 +143,21 @@ function processRequest(request: OnyxRequest, type: ApiRequestType): Promise<voi
* All calls to API.write() will be persisted to disk as JSON with the params, successData, and failureData (or finallyData, if included in place of the former two values).
* This is so that if the network is unavailable or the app is closed, we can send the WRITE request later.
*/
function write<TCommand extends WriteCommand>(command: TCommand, apiCommandParameters: ApiRequestCommandParameters[TCommand]): Promise<void | Response>;

function write<TCommand extends WriteCommand>(
function write<TCommand extends WriteCommand, TKey extends OnyxKey>(
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey> = {},
conflictResolver: RequestConflictResolver = {},
): Promise<void | Response> {
onyxData: OnyxData<TKey>,
conflictResolver?: RequestConflictResolver<TKey>,
): Promise<void | Response<TKey>>;

function write<TCommand extends WriteCommand, TKey extends OnyxKey>(
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<TKey> = {},
conflictResolver: RequestConflictResolver<TKey> = {},
): Promise<void | Response<TKey>> {
Log.info('[API] Called API write', false, {command, ...apiCommandParameters});
const request = prepareRequest(command, CONST.API_REQUEST_TYPE.WRITE, apiCommandParameters, onyxData, conflictResolver);
return processRequest(request, CONST.API_REQUEST_TYPE.WRITE);
Expand All @@ -159,14 +167,14 @@ function write<TCommand extends WriteCommand>(
* This function is used to write data to the API while ensuring that there are no duplicate requests in the queue.
* If a duplicate request is found, it resolves the conflict by replacing the duplicated request with the new one.
*/
function writeWithNoDuplicatesConflictAction<TCommand extends WriteCommand>(
function writeWithNoDuplicatesConflictAction<TCommand extends WriteCommand, TKey extends OnyxKey>(
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey> = {},
requestMatcher: RequestMatcher = (request) => request.command === command,
): Promise<void | Response> {
onyxData: OnyxData<TKey> = {},
requestMatcher: AnyRequestMatcher = (request) => request.command === command,
): Promise<void | Response<TKey>> {
const conflictResolver = {
checkAndFixConflictingRequest: (persistedRequests: OnyxRequest[]) => resolveDuplicationConflictAction(persistedRequests, requestMatcher),
checkAndFixConflictingRequest: (persistedRequests: AnyRequest[]) => resolveDuplicationConflictAction(persistedRequests, requestMatcher),
};

return write(command, apiCommandParameters, onyxData, conflictResolver);
Expand All @@ -176,13 +184,13 @@ function writeWithNoDuplicatesConflictAction<TCommand extends WriteCommand>(
* This function is used to write data to the API while ensuring that there are no conflicts with enabling policy features.
* If a conflict is found, it resolves the conflict by deleting the duplicated request.
*/
function writeWithNoDuplicatesEnableFeatureConflicts<TCommand extends EnablePolicyFeatureCommand>(
function writeWithNoDuplicatesEnableFeatureConflicts<TCommand extends EnablePolicyFeatureCommand, TKey extends OnyxKey>(
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey> = {},
): Promise<void | Response> {
onyxData: OnyxData<TKey> = {},
): Promise<void | Response<TKey>> {
const conflictResolver = {
checkAndFixConflictingRequest: (persistedRequests: OnyxRequest[]) => resolveEnableFeatureConflicts(command, persistedRequests, apiCommandParameters),
checkAndFixConflictingRequest: (persistedRequests: Array<OnyxRequest<TKey>>) => resolveEnableFeatureConflicts(command, persistedRequests, apiCommandParameters),
};

return write(command, apiCommandParameters, onyxData, conflictResolver);
Expand All @@ -196,11 +204,11 @@ function writeWithNoDuplicatesEnableFeatureConflicts<TCommand extends EnablePoli
* Using this method is discouraged and will throw an ESLint error. Use it sparingly and only when all other alternatives have been exhausted.
* It is best to discuss it in Slack anytime you are tempted to use this method.
*/
function makeRequestWithSideEffects<TCommand extends SideEffectRequestCommand>(
function makeRequestWithSideEffects<TCommand extends SideEffectRequestCommand, TKey extends OnyxKey>(
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey> = {},
): Promise<void | Response> {
onyxData: OnyxData<TKey> = {},
): Promise<void | Response<TKey>> {
Log.info('[API] Called API makeRequestWithSideEffects', false, {command, ...apiCommandParameters});
const request = prepareRequest(command, CONST.API_REQUEST_TYPE.MAKE_REQUEST_WITH_SIDE_EFFECTS, apiCommandParameters, onyxData);

Expand All @@ -222,7 +230,11 @@ function waitForWrites<TCommand extends ReadCommand | WriteCommand | SideEffectR
/**
* Requests made with this method are not be persisted to disk. If there is no network connectivity, the request is ignored and discarded.
*/
function read<TCommand extends ReadCommand>(command: TCommand, apiCommandParameters: ApiRequestCommandParameters[TCommand], onyxData: OnyxData<OnyxKey> = {}): void {
function read<TCommand extends ReadCommand>(command: TCommand, apiCommandParameters: ApiRequestCommandParameters[TCommand]): void;

function read<TCommand extends ReadCommand, TKey extends OnyxKey>(command: TCommand, apiCommandParameters: ApiRequestCommandParameters[TCommand], onyxData: OnyxData<TKey>): void;

function read<TCommand extends ReadCommand, TKey extends OnyxKey>(command: TCommand, apiCommandParameters: ApiRequestCommandParameters[TCommand], onyxData: OnyxData<TKey> = {}): void {
Log.info('[API] Called API.read', false, {command, ...apiCommandParameters});

// Apply optimistic updates of read requests immediately
Expand All @@ -237,38 +249,38 @@ function read<TCommand extends ReadCommand>(command: TCommand, apiCommandParamet
});
}

function paginate<TRequestType extends typeof CONST.API_REQUEST_TYPE.MAKE_REQUEST_WITH_SIDE_EFFECTS, TCommand extends CommandOfType<TRequestType>>(
function paginate<TRequestType extends typeof CONST.API_REQUEST_TYPE.MAKE_REQUEST_WITH_SIDE_EFFECTS, TCommand extends CommandOfType<TRequestType>, TKey extends OnyxKey>(
type: TRequestType,
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey>,
onyxData: OnyxData<TKey>,
config: PaginationConfig,
): Promise<Response | void>;
function paginate<TRequestType extends typeof CONST.API_REQUEST_TYPE.READ, TCommand extends CommandOfType<TRequestType>>(
function paginate<TRequestType extends typeof CONST.API_REQUEST_TYPE.READ, TCommand extends CommandOfType<TRequestType>, TKey extends OnyxKey>(
type: TRequestType,
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey>,
onyxData: OnyxData<TKey>,
config: PaginationConfig,
): void;
function paginate<TRequestType extends typeof CONST.API_REQUEST_TYPE.WRITE, TCommand extends CommandOfType<TRequestType>>(
function paginate<TRequestType extends typeof CONST.API_REQUEST_TYPE.WRITE, TCommand extends CommandOfType<TRequestType>, TKey extends OnyxKey>(
type: TRequestType,
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey>,
onyxData: OnyxData<TKey>,
config: PaginationConfig,
conflictResolver?: RequestConflictResolver,
conflictResolver?: RequestConflictResolver<TKey>,
): void;
function paginate<TRequestType extends ApiRequestType, TCommand extends CommandOfType<TRequestType>>(
function paginate<TRequestType extends ApiRequestType, TCommand extends CommandOfType<TRequestType>, TKey extends OnyxKey>(
type: TRequestType,
command: TCommand,
apiCommandParameters: ApiRequestCommandParameters[TCommand],
onyxData: OnyxData<OnyxKey>,
onyxData: OnyxData<TKey>,
config: PaginationConfig,
conflictResolver: RequestConflictResolver = {},
): Promise<Response | void> | void {
conflictResolver: RequestConflictResolver<TKey> = {},
): Promise<Response<TKey> | void> | void {
Log.info('[API] Called API.paginate', false, {command, ...apiCommandParameters});
const request: PaginatedRequest = {
const request: PaginatedRequest<TKey> = {
...prepareRequest(command, type, apiCommandParameters, onyxData, conflictResolver),
...config,
...{
Expand Down
5 changes: 3 additions & 2 deletions src/libs/ApiUtils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type {OnyxKey} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import CONFIG from '@src/CONFIG';
Expand Down Expand Up @@ -36,7 +37,7 @@ getEnvironment().then((envName) => {
* Get the currently used API endpoint, unless forceProduction is set to true
* (Non-production environments allow for dynamically switching the API)
*/
function getApiRoot(request?: Request, forceProduction = false): string {
function getApiRoot<TKey extends OnyxKey = never>(request?: Partial<Pick<Request<TKey>, 'shouldUseSecure' | 'shouldSkipWebProxy' | 'command'>>, forceProduction = false): string {
const shouldUseSecure = request?.shouldUseSecure ?? false;

if (shouldUseStagingServer && forceProduction !== true) {
Expand All @@ -55,7 +56,7 @@ function getApiRoot(request?: Request, forceProduction = false): string {
* Get the command url for the given request
* @param - the name of the API command
*/
function getCommandURL(request: Request): string {
function getCommandURL<TKey extends OnyxKey>(request: Request<TKey>): string {
// If request.command already contains ? then we don't need to append it
return `${getApiRoot(request)}api/${request.command}${request.command.includes('?') ? '' : '?'}`;
}
Expand Down
4 changes: 2 additions & 2 deletions src/libs/AppState/RequestsQueuesState/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {Request} from '@src/types/onyx';
import type {AnyRequest} from '@src/types/onyx';

/**
* Main queue state
Expand All @@ -11,7 +11,7 @@ type MainQueueInfo = {
queuedCommands?: string[];
};

type OngoingRequestInfo = Pick<Request, 'command' | 'persistWhenOngoing' | 'isRollback'>;
type OngoingRequestInfo = Pick<AnyRequest, 'command' | 'persistWhenOngoing' | 'isRollback'>;

/**
* Persisted requests state
Expand Down
20 changes: 16 additions & 4 deletions src/libs/HttpUtils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type {OnyxKey} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import alert from '@components/Alert';
Expand Down Expand Up @@ -53,7 +54,12 @@ const APICommandRegex = /\/api\/([^&?]+)\??.*/;
* Send an HTTP request, and attempt to resolve the json response.
* If there is a network error, we'll set the application offline.
*/
function processHTTPRequest(url: string, method: RequestType = 'get', body: FormData | null = null, abortSignal: AbortSignal | undefined = undefined): Promise<Response> {
function processHTTPRequest<TKey extends OnyxKey>(
url: string,
method: RequestType = 'get',
body: FormData | null = null,
abortSignal: AbortSignal | undefined = undefined,
): Promise<Response<TKey>> {
const startTime = new Date().valueOf();
return fetch(url, {
// We hook requests to the same Controller signal, so we can cancel them all at once
Expand Down Expand Up @@ -116,7 +122,7 @@ function processHTTPRequest(url: string, method: RequestType = 'get', body: Form
});
}

return response.json() as Promise<Response>;
return response.json() as Promise<Response<TKey>>;
})
.then((response) => {
// Some retried requests will result in a "Unique Constraints Violation" error from the server, which just means the record already exists
Expand Down Expand Up @@ -148,7 +154,7 @@ function processHTTPRequest(url: string, method: RequestType = 'get', body: Form
// Trigger a modal and disable the app as the user needs to upgrade to the latest minimum version to continue
alertUser();
}
return response as Promise<Response>;
return response;
});
}

Expand All @@ -159,7 +165,13 @@ function processHTTPRequest(url: string, method: RequestType = 'get', body: Form
* @param type HTTP request type (get/post)
* @param shouldUseSecure should we use the secure server
*/
function xhr(command: string, data: Record<string, unknown>, type: RequestType = CONST.NETWORK.METHOD.POST, shouldUseSecure = false, initiatedOffline = false): Promise<Response> {
function xhr<TKey extends OnyxKey>(
command: string,
data: Record<string, unknown>,
type: RequestType = CONST.NETWORK.METHOD.POST,
shouldUseSecure = false,
initiatedOffline = false,
): Promise<Response<TKey>> {
return prepareRequestPayload(command, data, initiatedOffline).then((formData) => {
const url = getCommandURL({shouldUseSecure, command});
const abortSignalController = data.canCancel ? (abortControllerMap.get(command as AbortCommand) ?? abortControllerMap.get(ABORT_COMMANDS.All)) : undefined;
Expand Down
3 changes: 2 additions & 1 deletion src/libs/Middleware/HandleUnusedOptimisticID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as PersistedRequests from '@userActions/PersistedRequests';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PersonalDetailsList} from '@src/types/onyx';
import type Report from '@src/types/onyx/Report';
import type {AnyOnyxUpdate} from '@src/types/onyx/Request';
import {isEmptyObject} from '@src/types/utils/EmptyObject';

// Local cache of reportID to optimistic Onyx data
Expand Down Expand Up @@ -80,7 +81,7 @@ const handleUnusedOptimisticID: Middleware = (requestResponse, request, isFromSe
const {settledPersonalDetails, redundantParticipants} = reportOptimisticData.get(currentRequestReportID) ?? {};
reportOptimisticData.delete(currentRequestReportID);
if (!isEmptyObject(settledPersonalDetails) && !isEmptyObject(redundantParticipants)) {
response.onyxData.push(
(response.onyxData as AnyOnyxUpdate[]).push(
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${currentRequestReportID}`,
Expand Down
3 changes: 2 additions & 1 deletion src/libs/Middleware/Logging.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type {OnyxKey} from 'react-native-onyx';
import {SIDE_EFFECT_REQUEST_COMMANDS} from '@libs/API/types';
import type HttpsError from '@libs/Errors/HttpsError';
import Log from '@libs/Log';
Expand Down Expand Up @@ -34,7 +35,7 @@ function serializeLoggingData<T extends Record<string, unknown> | undefined>(log
}
}

function logRequestDetails(message: string, request: Request, response?: Response | void) {
function logRequestDetails<TKey extends OnyxKey>(message: string, request: Request<TKey>, response?: Response<TKey> | void) {
// Don't log about log or else we'd cause an infinite loop
if (request.command === 'Log') {
return;
Expand Down
Loading
Loading