Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dev env param #33776

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/libs/Network/enhanceParameters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as Environment from '@libs/Environment/Environment';
import getPlatform from '@libs/getPlatform';
import CONFIG from '@src/CONFIG';
import * as NetworkStore from './NetworkStore';
Expand Down Expand Up @@ -37,6 +38,8 @@ export default function enhanceParameters(command: string, parameters: Record<st
// Include current user's email in every request and the server logs
finalParameters.email = parameters.email ?? NetworkStore.getCurrentUserEmail();

finalParameters.isFromDevEnv = Environment.isDevelopment();

// idempotencyKey declared in JS is front-end-only. We delete it here so it doesn't interfere with idempotency in other layers.
delete finalParameters.idempotencyKey;

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/enhanceParametersTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test('Enhance parameters adds correct parameters for Log command with no authTok
testParameter: 'test',
api_setCookie: false,
email,
isFromDevEnv: true,
platform: 'ios',
referer: CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER,
});
Expand All @@ -36,6 +37,7 @@ test('Enhance parameters adds correct parameters for a command that requires aut
testParameter: 'test',
api_setCookie: false,
email,
isFromDevEnv: true,
platform: 'ios',
authToken,
referer: CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER,
Expand Down