-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2023-05-22] [$1000] Infinite loading when returning back from Plaid if user hits CTRL+SHIFT+K before the Plaid page opens up #17598
Comments
Triggered auto assignment to @laurenreidexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~01bb5f680944cd2fd8 |
Current assignee @laurenreidexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav ( |
Triggered auto assignment to @aldo-expensify ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.We are trying to solve the broken infinite loader when coming back from plaid if user had pressed CTRL+SHIFT+K before the plaid page is opened What is the root cause of that problem?In the
and we come back from the plaid page we trigger the What changes do you think we should make in order to solve the problem?I think we should not mix workflows here as creating a new group and adding a bank/plaid account are 2 separate workflows, instead we should block one of these. I would suggest to implement an option from the following
const groupShortcutConfig = CONST.KEYBOARD_SHORTCUTS.NEW_GROUP;
this.unsubscribeGroupShortcut = KeyboardShortcut.subscribe(
groupShortcutConfig.shortcutKey,
() => {}, // do nothing
groupShortcutConfig.descriptionKey,
groupShortcutConfig.modifiers,
true, // captureOnInputs
false, // shouldBubble
0, // priority (0=high)
true // shouldPreventDefault (could be false as well)
);
const groupShortcutConfig = CONST.KEYBOARD_SHORTCUTS.NEW_GROUP;
this.unsubscribeGroupShortcut = KeyboardShortcut.subscribe(
groupShortcutConfig.shortcutKey,
this.props.onExitPlaid, // call the exit plaid cb
groupShortcutConfig.descriptionKey,
groupShortcutConfig.modifiers,
true, // captureOnInputs
true, // shouldBubble
0, // priority (0=high)
false // shouldPreventDefault
); With both the options above we should unsubscribe to the group shortcut when the component unmounts componentWillUnmount() {
if (this.unsubscribeGroupShortcut) {
this.unsubscribeGroupShortcut();
}
} What alternative solutions did you explore? (Optional)We could allow the user to use both the shortcut key and be able to use plaid, but I think it as mixing cross cutting concerns/workflows. To implement this we need change the order of navigation i.e put
now when the user will be navigated back from plaid he will see the |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Infinite loading when returning back from Plaid if user hits CTRL+SHIFT+K before the Plaid page opens up What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?I think when we exit Plaid, we would like go back to the payment page so user can select another method or do something else. So I think we can replace Navigation.goBack by explicitly navigate to route of the payment page in this line Code reference: onExitPlaid={() => { Navigation.navigate(ROUTES.SETTINGS_PAYMENTS); }} |
ProposalPlease re-state the problem that we are trying to solve in this issue.Infinite loading when returning back from plaid if user hits CTRL+SHIFT+K before plaids page open up What is root cause of that problem?When the user exits plaid, the
What Changes do you think we should make in order to solve the problem?Logically, if a user hits CTRL+SHIFT+K, then the user must have made a change of mind and wants to create a new group instead of adding a bank account or opening the plaid page. Therefore we should cancel/prevent the plaid page from being opened and allow the user to proceed by creating a new group. This can be achieved by removing the We can implement the above solution simply by navigating back before opening the modal- that is the new group modal - in AuthScreen here. Code Reference:
If it is necessary, we can execute the above Navigation.goBack() method only if the current screen is This issue also occurs if the user hit CTRL+K in addition to CTRL+SHIFT+K so we need to add
|
Alternatively, if we don’t want the plaid page to be prevented from being opened but want to show the new group modal when the user exits the plaid instead of the infinite loading, We can achieve that as shown below.
ResultWorking well after using the alternative approach Screencast-another.mov |
@0xmiroslav bump for review ^^ |
ProposalPlease re-state the problem that we are trying to solve in this issue.Infinite loading when returning back from Plaid if user hits CTRL+SHIFT+K before the Plaid page opens up What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?Solution A:When we execute the shortcut key to open a new window, we should actually close the old window. As we add more and more shortcut keys, users may misremember the shortcut keys, so we need to give user feedback every time when the shortcut key is pressed I hope this solution can both solves #17598 and #17482
_before.movIt Can be reproduced in production environment, We can clearly see that when multiple Modals overlap, the App/src/libs/Navigation/AppNavigator/modalCardStyleInterpolator.js Lines 39 to 43 in 6fb0969
+ index,
current: {progress},
...
- opacity: progress.interpolate({
+ opacity: index == 0 ? progress.interpolate({
inputRange: [0, 1],
outputRange: [0, variables.overlayOpacity],
extrapolate: 'clamp',
- }),
+ }) : 0,
We add the function resetModalRoute(route) {
const activeState = getActiveState();
const newStateFromRoute = getStateFromPath(route, linkingConfig.config);
const action = getActionFromState(newStateFromRoute, linkingConfig.config);
let actionType = activeState.routes.length > 1 ? StackActions.replace('').type : CommonActions.navigate('').type
navigationRef.current.dispatch({
...action,
type: actionType,
target: activeState.key,
});
} _after.movSolution B:
Solution C:
What alternative solution did you explore? (Optional)Not Yet |
@0xmiroslav bump ^^ |
reviewing proposals |
Tested more the option of blocking based on the URL and we ended up deciding that it blocks the shortcut for more time (views) that we would like. We are going to go with @huzaifa-99 's first option in this proposal, but with slightly different parameters to not block the shortcuts when the plaid modal is gone: this.unsubscribeGroupShortcut = KeyboardShortcut.subscribe(
groupShortcutConfig.shortcutKey,
() => {}, // do nothing
groupShortcutConfig.descriptionKey,
groupShortcutConfig.modifiers,
false,
() => lodashGet(this.props.plaidData, 'bankAccounts', []).length > 0,
); The redefinition of shortcuts to block them is also a pattern here: App/src/components/KeyboardShortcutsModal.js Lines 74 to 93 in bb13d03
Also, to keep things easier to maintain.. we could consider is to adding a property these shortcut constants like this: SEARCH: {
descriptionKey: 'search',
shortcutKey: 'K',
modifiers: ['CTRL'],
trigger: {
DEFAULT: {input: 'k', modifierFlags: keyModifierControl},
[PLATFORM_OS_MACOS]: {input: 'k', modifierFlags: keyModifierCommand},
[PLATFORM_IOS]: {input: 'k', modifierFlags: keyModifierCommand},
},
+. type: NAVIGATION_SHORTCUT_TYPE
}, where |
📣 @huzaifa-99 You have been assigned to this job by @aldo-expensify! |
@aldo-expensify @0xmiroslav PR#18462 is up for review. @aldo-expensify I followed the shortcuts redefinition pattern and also added a |
Note to self: offers sent to @priya-zha @0xmiroslav @huzaifa-99 in Upwork |
Accepted, Thank you @laurenreidexpensify |
No overdue, PR under review |
PR merged |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.13-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-05-22. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Everyone has been paid - @0xmiroslav let me know when you've completed steps above so we can close. Thanks! |
No PR caused regression. The issue always existed after we implement shortcut keys. |
@laurenreidexpensify this is eligible for timeline bonus. PR was merged within 5 days including weekend. |
@0xmiroslav I had the same thought. Thanks for pointing out! |
Ah sorry folks I missed that was during the weekend. Will issue a bonus now. |
bonuses issued. confirmed no further regression steps. closing. thanks everyone! |
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:
Expected Result:
There should not be infinite loading on returning back from Plaid URL if user hits CTRL+SHIFT+K key before the plaid URL opens up
Actual Result:
There is infinite loading on the right hand side menu
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
error-2023-04-17_19.50.34.mp4
Recording.267.mp4
Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681740790785869
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: