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 missing default value to extras #696

Merged

Conversation

war-in
Copy link
Contributor

@war-in war-in commented May 14, 2024

Fixed Issues

42161

Tests

  1. What unit/integration tests cover your change? What autoQA tests cover your change?
  2. What tests did you perform that validates your changed worked?

QA

  1. What does QA need to do to validate your changes?
  2. What areas to they need to test for regressions?

@war-in war-in marked this pull request as ready for review May 14, 2024 15:43
@war-in war-in requested a review from a team as a code owner May 14, 2024 15:43
@melvin-bot melvin-bot bot requested review from jasperhuangg and removed request for a team May 14, 2024 15:44
@iwiznia iwiznia requested review from iwiznia and removed request for jasperhuangg May 14, 2024 16:09
Comment on lines 476 to 477
// eslint-disable-next-line no-console
console.warn(`[ExpensiMark] Missing report name for ID: ${ g1}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this is not what I meant, we don't use console like this (as the linter is telling you). You should log using the Log class. Also please change them all to alert instead of warn.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other places in ExpensiMark.js there is no Log class usages - only console.warn is used twice. That's why we have done it this way. I can change it though if you think that Log is more suitable in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we use. In expensimark there are some console.warn s. That's why I've used it. Can change if you want :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmmm not sure why we do that, but in this case, we want the log to go to our servers or we will never know it happened, since we don't have access to user's consoles.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked quickly and I don't see any usage of Log from expensify-common in E/App as well . Can we for now stay with the console.warn and check it as followup so we will fix the issue with missing extras quicker?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might not be using it yet, but it exists, no? Is it causing any problems if you use it? Not sure I understand the pushback...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just don't want to introduce any regression as Log is not yet used in ExpensiMark.
It's not a problem to change it, let me check more extensively in E/App. I'll ping you once I'll do it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine, but tests are failing - I'm on it right now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iwiznia I've pushed remaining changes. Tests were failing due to wrong test environment (as now we need window to be defined - this is used in log implementation)

@@ -473,7 +474,8 @@ export default class ExpensiMark {
replacement: (match, g1, offset, string, extras) => {
const reportToNameMap = extras.reportIdToName;
if (!reportToNameMap || !reportToNameMap[g1]) {
return '';
Log.alert(`[ExpensiMark] Missing report name for ID: ${g1}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable parameters should go in the 2nd parameter of the call, so:

Suggested change
Log.alert(`[ExpensiMark] Missing report name for ID: ${g1}`);
Log.alert('[ExpensiMark] Missing report name', {reportID: g1});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved 👌🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants