-
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 2024-12-25] [Hold for #53360] [$250] Company cards toggle is disabled after upgrading workspace on mobile #53505
Comments
Triggered auto assignment to @sonialiap ( |
I already worked on company card project so I would like to take it as C+ |
Job added to Upwork: https://www.upwork.com/jobs/~021864369617192885056 |
Current assignee @dukenv0307 is eligible for the External assigner, not assigning anyone new. |
Not reproducible on iOS: Native, if this is reproducible only on iOS: HybridApp then it should be |
ProposalPlease re-state the problem that we are trying to solve in this issue.Company cards toggle is disabled after upgrading workspace on mobile What is the root cause of that problem?This issue occurred in this pull request: #49937. After migrating E/App to
For this reason,
The screen is unmounted immediately when navigating away in case of native stack, so we won't get any events from react-navigation/react-navigation#11788 (comment) What changes do you think we should make in order to solve the problem?To resolve this issue, we should use
//src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx#L158
useFocusEffect(
useCallback(() => {
return () => {
if (!isUpgraded || !canPerformUpgrade) {
return;
}
confirmUpgrade();
};
}, [isUpgraded, canPerformUpgrade, confirmUpgrade]),
); POCScreen.Recording.2024-12-06.at.01.32.51.mp4N/A What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Thank you @huult, but I don't think it's the best idea since we're using
It would be great if we can fix this issue |
@dukenv0307 Issue:The Solution:Instead of replacing Key to Fix:
Here's an updated version of the
|
@dukenv0307 Firstly, I would like to say thank you for reviewing my proposal
Since this issue only happens on the Native Stack, it means it will occur on both native Android and iOS. I believe the issue might also happen elsewhere. Therefore, I suggest creating a custom hook,ex: useOnBlur, with two files: index.ts and index.native.ts, to handle native and web platforms. This approach will make it easier to apply the solution elsewhere.
As mentioned in this comment react-navigation/react-navigation#11788 (comment), they confirmed that addListener with blur does not work on the Native Stack, so we can't fix it. They suggested using useFocusEffect to handle this issue. Therefore, I think we should use useFocusEffect for native platforms and blur for the web. |
Dupe of #53360... |
Putting this on hold for #53360 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.76-12 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 2024-12-25. 🎊 For reference, here are some details about the assignees on this issue:
|
@dukenv0307 @sonialiap @dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number:
Reproducible in staging?:
Reproducible in production?:
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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
Expensify/Expensify Issue URL:
Issue reported by: @joekaufmanexpensify
Slack conversation (hyperlinked to channel name): ts_external_expensify_expense
Action Performed:
Prerequisite: Workspace created and on collect policy
Expected Result:
Company cards toggle button in enabled condition as user upgraded to control policy
Actual Result:
Company cards toggle button in disabled condition
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
2024-12-02_16-02-53.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @sonialiapThe text was updated successfully, but these errors were encountered: