Closed anmurali closed 6 days ago
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf (External
)
β οΈ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.
Job added to Upwork: https://www.upwork.com/jobs/~021854652609104860244
Current assignee @allgandalf is eligible for the External assigner, not assigning anyone new.
Edited by proposal-police: This proposal was edited at 2024-11-08 08:54:50 UTC.
we always call Linking.openURL
which will open a new tab.
shouldOpenInSameTab
:const asyncOpenURL: AsyncOpenURL = (promise, url, shouldSkipCustomSafariLogic, shouldOpenInSameTab = false) => {
and use it in:
if (shouldOpenInSameTab) {
window.location.href = typeof url === 'string' ? url : url(params);
return;
}
Linking.openURL(typeof url === 'string' ? url : url(params));
function openOldDotLink(url: string, shouldOpenInSameTab = false) {
and
(oldDotURL) => oldDotURL, undefined, shouldOpenInSameTab
Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX, true);
@allgandalf this is a critical issue as we have a lot of confused users, so appreciate you picking a proposal from above as soon as possible!
Switch to classic in the same tab
To open a new URL, we use Linking.openURL
finally.
Btw, this function opens URLs in the deviceβs default browser or a compatible app, without options to specify the tab.
So we should add new logic for opening URLs at the same tab.
I changed this function; https://github.com/Expensify/App/blob/daf0addf17040ae0b0ad76e9705d20a7143b9a39/src/libs/actions/Link.ts#L72-L86 The changed function is following;
function openOldDotLink(url: string, shouldOpenInSameTab: boolean = false) {
if (isNetworkOffline) {
buildOldDotURL(url).then((oldDotURL) => openExternalLink(oldDotURL));
return;
}
// If shortLivedAuthToken is not accessible, fallback to opening the link without the token.
// eslint-disable-next-line rulesdir/no-api-side-effects-method
const promise = API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.OPEN_OLD_DOT_LINK, {}, {})
.then((response) => (response ? buildOldDotURL(url, response.shortLivedAuthToken) : buildOldDotURL(url)))
.catch(() => buildOldDotURL(url));
if (shouldOpenInSameTab && Platform.OS === 'web') {
promise.then((oldDotURL) => window.open(oldDotURL, '_self'));
} else {
asyncOpenURL(
promise,
(oldDotURL) => oldDotURL,
);
}
}
Next, we should pass a param for opening URLs at same tab.
https://github.com/Expensify/App/blob/daf0addf17040ae0b0ad76e9705d20a7143b9a39/src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx#L86
Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX, true);
N/A
Your Expensify account email: anasup1995@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01aff093c9a804b145
β Contributor details stored successfully. Thank you for contributing to Expensify!
We want to open the expensify classic on the same tab.
We use Linking.openURL
which by default always opens the URL on a new tab.
First, add a new param to tell whether to open the URL on the same tab or not. Let's call it shouldOpenInSameTab
.
https://github.com/Expensify/App/blob/daf0addf17040ae0b0ad76e9705d20a7143b9a39/src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx#L86
We will pass this param to openOldDotLink
, openExternalLink
, and asyncOpenURL
.
https://github.com/Expensify/App/blob/daf0addf17040ae0b0ad76e9705d20a7143b9a39/src/libs/actions/Link.ts#L68-L86
In asyncOpenURL (the .website.ts file), if shouldOpenInSameTab
is true, we will always use the Linking.openURL (the if
block).
https://github.com/Expensify/App/blob/daf0addf17040ae0b0ad76e9705d20a7143b9a39/src/libs/asyncOpenURL/index.website.ts#L14-L25
Then, pass _self
as the target if shouldOpenInSameTab
is true. target param for Linking.openURL is available for react-native-web.
Linking.openURL(typeof url === 'string' ? url : url(params), shouldOpenInSameTab ? '_self' : undefined);
Thanks for the proposals everyone π
Let's go with @bernhardoj's proposal here, their RCA is correct and solution makes sense to me
πππ C+ reviewed
Triggered auto assignment to @neil-marcellini, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Heads up I'm OOO next week and won't have time to review this before then.
@allgandalf - I unassigned Neil. Can you re-add the C+ reviewed message so we can get someone else assigned?
πππ C+ reviewed, summary here @chiragsalian
Triggered auto assignment to @chiragsalian, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Proposal LGTM, feel free to create the PR @bernhardoj.
π£ @allgandalf π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
PR is ready
cc: @allgandalf
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.65-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-11-29. :confetti_ball:
For reference, here are some details about the assignees on this issue:
[x] [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A (It always worked this way, we decided to change the behaviour)
[x] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[x] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[x] [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/448657
For web/mWeb,
For desktop/iOS/Android,
Do we agree π or π
@anmurali can you please assign a BZ for payment or pay out this one :) thanks
Triggered auto assignment to @kadiealexander (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@anmurali can you please assign a BZ for payment or pay out this one :) thanks
Done, payment due tomorrow!
Payouts due:
Upwork job is here.
Requested in ND.
Problem: When a user switches to classic, we open www.expensify.com in a new tab. It isn't intuitive to them to close that tab on web. As a result they switch over and over again.
Solution: When a user switches to Classic, open www.expensify.com in the same tab, rather than a new tab
Issue Owner
Current Issue Owner: @Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @kadiealexander