Skip to content

[HOLD][$250] Dev - Getting console warning in android #11733

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

Closed
kavimuru opened this issue Oct 11, 2022 · 42 comments
Closed

[HOLD][$250] Dev - Getting console warning in android #11733

kavimuru opened this issue Oct 11, 2022 · 42 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Oct 11, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. build the app
  2. immediately see the errors

Expected Result:

No console warnings displayed

Actual Result:

Console warnings about keyboardAvoidingViewBehavior are present

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Android

Version Number: 1.2.12-3
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
2022-10-11_11-14-40
2022-10-11_11-14-48

Expensify/Expensify Issue URL:
Issue reported by: @aneequeahmad
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1665522948008369

View all open jobs on GitHub

@kavimuru kavimuru added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 Needs Reproduction Reproducible steps needed labels Oct 11, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 11, 2022

Triggered auto assignment to @MitchExpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@melvin-bot melvin-bot bot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Oct 11, 2022
@aimane-chnaif
Copy link
Contributor

Proposal

keyboardAvoidingViewBehavior={Platform.OS === 'android' ? '' : 'padding'}

The issue happens from above line added here

keyboardAvoidingViewBehavior: PropTypes.oneOf(['padding', 'height', 'position']),

keyboardAvoidingViewBehavior props value is expected one of these 3 but in android it's set to ''

Solution:

-               keyboardAvoidingViewBehavior={Platform.OS === 'android' ? '' : 'padding'}

remove this line
By doing this, android keyboardAvoidingViewBehavior set to height and iOS keyboardAvoidingViewBehavior keeps padding unchanged.

The default values are found here
ios:

keyboardAvoidingViewBehavior: 'padding',

android:
defaultProps.keyboardAvoidingViewBehavior = 'height';

@hungvu193
Copy link
Contributor

hungvu193 commented Oct 12, 2022

Actually, change the default proptypes can effect other screens.
For this case I think we should change:

keyboardAvoidingViewBehavior={Platform.OS === 'android' ? '' : 'padding'}

into:

-  keyboardAvoidingViewBehavior={Platform.OS === 'android' ? '' : 'padding'} 
+  keyboardAvoidingViewBehavior={Platform.OS === 'android' ? undefined : 'padding'} 

After that, the warning will disappear and also it won't effect other screens.

@thesahindia
Copy link
Member

I vote we close this issue as it's not a big problem and will be fixed after #10648

@marcaaron
Copy link
Contributor

Please wait until the issue has been triaged and Help Wanted label added.

@marcaaron marcaaron added Engineering External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Oct 12, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2022

Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2022

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 12, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2022

Triggered auto assignment to @Luke9389 (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot changed the title Dev - Getting console warning in android [$250] Dev - Getting console warning in android Oct 12, 2022
@marcaaron
Copy link
Contributor

I vote we close this issue as it's not a big problem

I am not opposed to waiting if there's an open PR where it will be fixed, but let's leave this issue open until it is fixed. It's a problem, that's why I reported it, and we should fix it.

@parasharrajat
Copy link
Member

Strangely, that component is using Platform API. We are discussing to revert it in #10648. I am not sure when that will be done.

@marcaaron Do you want me to look into proposals or hold this?

@marcaaron
Copy link
Contributor

If we can fix this now it is fine to just do it.

@marcaaron
Copy link
Contributor

We should generally not be merging PRs that introduce these kinds of warnings.

@parasharrajat
Copy link
Member

I agree. Looks like there was discussion on the same https://github.com/Expensify/App/pull/10567/files#r955053952.

@parasharrajat
Copy link
Member

parasharrajat commented Oct 12, 2022

@aimane-chnaif 's proposal looks good to me.

That line looks unnecessary to me as well.

cc: @Luke9389

@marcaaron
Copy link
Contributor

cc @Luke9389 as I am not the assigned CME

@parasharrajat
Copy link
Member

Oh Sorry, Didn't notice.

@Luke9389
Copy link
Contributor

I think @aimane-chnaif's proposal to set the android value to height will cause this issue again (that's why we made this PR)

@parasharrajat
Copy link
Member

So the android value is already set to height, it is just removing that warning.

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Oct 13, 2022

I don't find any issue on setting keyboardAvoidingViewBehavior=height in android. It doesn't cause any regression.
And it was me linking correct PR and comment exactly related to this GH.

keyboardAvoidingViewEnabled is a must-have props in ScreenWrapper in the future but still it requires platform specific code in this Report page which violates code philosophy.
keyboardAvoidingViewEnabled={Platform.OS === 'ios'}
or keyboardAvoidingViewEnabled={Platform.OS !== 'android'}

BTW, I am just notified this: #10273 (comment)
And this master PR removes that line as I proposed.
So I think we can wait for that PR to be merged and then go ahead the next step.

@Luke9389
Copy link
Contributor

@aimane-chnaif, please be careful here. There is a known issue that we've linked to that is caused by using height. Are you really 100% positive that you checked that problem?

I do agree that we should wait on this PR to be merged. If the issue is still happening, I'd prefer to go with option 2 from @parasharrajat's comment here. @parasharrajat I don't like option 1 very much because it seems like an anti-pattern to have a component enable or disable itself (as opposed to just not using it in the parent).

For now I'd like to put this issue on HOLD to wait for that PR. Thoughts @parasharrajat?

@parasharrajat
Copy link
Member

fine with me.

@Luke9389 Luke9389 changed the title [$250] Dev - Getting console warning in android [HOLD][$250] Dev - Getting console warning in android Oct 14, 2022
@melvin-bot melvin-bot bot added the Overdue label Oct 17, 2022
@Luke9389
Copy link
Contributor

On HOLD.

@melvin-bot melvin-bot bot removed the Overdue label Oct 17, 2022
@puneetlath puneetlath added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 19, 2022
@melvin-bot melvin-bot bot added the Overdue label Oct 20, 2022
@Luke9389 Luke9389 added Weekly KSv2 and removed Daily KSv2 labels Oct 20, 2022
@melvin-bot melvin-bot bot removed the Overdue label Oct 20, 2022
@aneequeahmad
Copy link
Contributor

I think i should also be added in reporter as I reported this bug on 1st September here and again same error on another component on 28th September here. Thanks

cc: @kavimuru, @MitchExpensify, @Luke9389

@MitchExpensify
Copy link
Contributor

MitchExpensify commented Oct 27, 2022

Looks fair to me @aneequeahmad! Added you as a reporter

@MitchExpensify
Copy link
Contributor

I'm going to hold on the Upwork job while the issue is on hold

@melvin-bot melvin-bot bot added the Overdue label Nov 7, 2022
@Luke9389
Copy link
Contributor

Luke9389 commented Nov 7, 2022

still on hold

@melvin-bot melvin-bot bot removed the Overdue label Nov 7, 2022
@aimane-chnaif
Copy link
Contributor

#11586 is merged already and the current codebase is what I proposed here.
Since this issue no longer happens, can be closed now.

@melvin-bot melvin-bot bot added the Overdue label Nov 16, 2022
@MitchExpensify
Copy link
Contributor

@Luke9389 What do you think about closing this given the above comment?

@melvin-bot melvin-bot bot removed the Overdue label Nov 17, 2022
@Luke9389
Copy link
Contributor

Gotta read this one back over.

@Luke9389
Copy link
Contributor

Yep we can close this now. Thanks @aimane-chnaif.

@aneequeahmad
Copy link
Contributor

@MitchExpensify This one is fixed in production, am i eligible for reporting bonus ?

@MitchExpensify
Copy link
Contributor

Yes @aneequeahmad, paying now

@MitchExpensify
Copy link
Contributor

Mind applying here and I'll issue the reporting bonus? Thanks @aneequeahmad

@aneequeahmad
Copy link
Contributor

@MitchExpensify applied thanks

@MitchExpensify
Copy link
Contributor

Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants