Remove “Switch to Classic” feedback survey if responded in last month#74711
Remove “Switch to Classic” feedback survey if responded in last month#74711puneetlath merged 9 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@hungvu193 @joekaufmanexpensify The auto assignment was wrong. I don't know why it assigns this PR to you two. @ishpaul777 will be the reviewer here |
|
Ishpaul will handle internal issue from now on so I think that's why it doesn't auto assign him. What's the purpose of this PR btw? I thought the issue was all set 🤔 |
We update the timestamp to prevent issue from happening in old dot |
|
Yeah, seems like we are still discussing whether to proceed here. Given @ishpaul777 was the reviewer for the issue though, I expect we will have him do this quickly if we end up proceeding with it |
|
yes i can take this one as follow up to that PR. |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good from a product perspective
|
on my list will review today |
| let timestampToCheck: Date = tryNewDot.classicRedirect?.timestamp; | ||
|
|
||
| if (dismissedReasons && dismissedReasons.length > 0) { | ||
| const earliestReason = dismissedReasons.reduce((earliest, current) => { |
There was a problem hiding this comment.
this should be latest not earliest, we want to know lastTime user redirected from ND -> OD and compare if 30 days against that #73436 (comment)
|
@lorretheboy gentle bump! |
|
@ishpaul777 Please check again. I just fixed it. Thx |
|
ESLint check failed does not relate to this PR I think |
|
seems related to changed files and quick fix, lets fix this @lorretheboy |
|
🚧 @MonilBhavsar has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@lorretheboy i think this is still not working as expected
Screen.Recording.2025-11-18.at.11.14.52.PM.mov |
| const surveyCompletedWithinLastMonth = useMemo(() => { | ||
| const surveyThresholdInDays = 30; | ||
| if (!tryNewDot?.classicRedirect?.timestamp || !tryNewDot?.classicRedirect?.dismissed) { | ||
| if (!tryNewDot?.classicRedirect?.dismissed) { | ||
| return false; | ||
| } | ||
| const daysSinceLastSurvey = differenceInDays(new Date(), new Date(tryNewDot.classicRedirect.timestamp)); | ||
|
|
||
| const dismissedReasons = tryNewDot.classicRedirect?.dismissedReasons; | ||
| let timestampToCheck: Date = tryNewDot.classicRedirect?.timestamp; | ||
|
|
||
| if (dismissedReasons && dismissedReasons.length > 0) { | ||
| const latestReason = dismissedReasons.reduce((latest, current) => { | ||
| const currentDate = current.timestamp; | ||
| const latestDate = latest.timestamp; | ||
| return currentDate > latestDate ? current : latest; | ||
| }); | ||
| timestampToCheck = latestReason.timestamp; | ||
| } | ||
|
|
||
| if (!timestampToCheck) { | ||
| return false; | ||
| } | ||
|
|
||
| const daysSinceLastSurvey = differenceInDays(new Date(), timestampToCheck); | ||
| return daysSinceLastSurvey < surveyThresholdInDays; | ||
| }, [tryNewDot?.classicRedirect?.timestamp, tryNewDot?.classicRedirect?.dismissed]); | ||
| }, [tryNewDot?.classicRedirect?.timestamp, tryNewDot?.classicRedirect?.dismissed, tryNewDot?.classicRedirect?.dismissedReasons]); |
There was a problem hiding this comment.
please check this i think this should work correctly
const surveyCompletedWithinLastMonth = useMemo(() => {
const surveyThresholdInDays = 30;
const {dismissedReasons} = tryNewDot?.classicRedirect ?? {};
if (dismissedReasons?.length === 0) {
return false;
}
let timestampToCheck;
if (dismissedReasons && dismissedReasons.length > 0) {
const latestReason = dismissedReasons.reduce((latest, current) => {
const currentDate = current.timestamp;
const latestDate = latest.timestamp;
return currentDate > latestDate ? current : latest;
});
timestampToCheck = latestReason.timestamp;
}
if (!timestampToCheck) {
return false;
}
const daysSinceLastSurvey = differenceInDays(new Date(), timestampToCheck);
return daysSinceLastSurvey < surveyThresholdInDays;
}, [tryNewDot?.classicRedirect]);
|
@lorretheboy please take this with priorty, thanks! |
|
@ishpaul777 I will update it shortly |
|
@ishpaul777 hmm it looks like BE has just updated something. Currently, after switch to OD and tap back to {
"classicRedirect": {
"completedHybridAppOnboarding": true,
"dismissed": false,
"timestamp": "2025-11-20T16:13:11.793Z"
},
"tappedTryNewExpensifyButton": {
"timestamp": "2025-11-20T16:13:11.793Z"
}
}There is no |
|
is classicRedirect.timestamp now not resetted when when user click try new expensify button? i see this pr on frontend made changes to exit survey flow, @puneetlath do you know if we made any BE changes also ? |
|
Investigated this on BE and found the root cause why dismissedReasons is missing |
|
@lorretheboy we fixed it on Backend, can you please retest? |
|
@ishpaul777 I just tested, it works fine. Maybe we can request adhoc build to double check again? |
|
🚧 @puneetlath has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Screen.Recording.2025-11-27.at.02.42.00.mov@ishpaul777 Please do the final review. I tested the adhoc build, it works |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-11-27.at.6.25.01.AM.movAndroid: mWeb ChromeScreen.Recording.2025-11-27.at.6.01.38.AM.moviOS: HybridAppScreenRecording_11-27-2025.06-03-47_1.MP4iOS: mWeb SafariScreenRecording_11-27-2025.06-10-44_1.MP4MacOS: Chrome / SafariScreen.Recording.2025-11-27.at.5.57.58.AM.mov |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const surveyCompletedWithinLastMonth = useMemo(() => { | ||
| const surveyThresholdInDays = 30; | ||
| if (!tryNewDot?.classicRedirect?.timestamp || !tryNewDot?.classicRedirect?.dismissed) { | ||
| const {dismissedReasons} = tryNewDot?.classicRedirect ?? {}; | ||
| if (dismissedReasons?.length === 0) { | ||
| return false; | ||
| } | ||
| const daysSinceLastSurvey = differenceInDays(new Date(), new Date(tryNewDot.classicRedirect.timestamp)); | ||
|
|
||
| let timestampToCheck; | ||
| if (dismissedReasons && dismissedReasons.length > 0) { | ||
| const latestReason = dismissedReasons.reduce((latest, current) => { | ||
| const currentDate = current.timestamp; | ||
| const latestDate = latest.timestamp; | ||
| return currentDate > latestDate ? current : latest; | ||
| }); | ||
| timestampToCheck = latestReason.timestamp; | ||
| } | ||
|
|
||
| if (!timestampToCheck) { | ||
| return false; | ||
| } | ||
|
|
||
| const daysSinceLastSurvey = differenceInDays(new Date(), timestampToCheck); | ||
| return daysSinceLastSurvey < surveyThresholdInDays; | ||
| }, [tryNewDot?.classicRedirect?.timestamp, tryNewDot?.classicRedirect?.dismissed]); | ||
| }, [tryNewDot?.classicRedirect]); |
There was a problem hiding this comment.
Survey skip ignores existing dismissal timestamp
The new surveyCompletedWithinLastMonth logic now only looks at classicRedirect.dismissedReasons to decide whether to bypass the Classic feedback survey. That array is optional and is not written anywhere else in the client, while the rest of the app (e.g., InitialSettingsPage) still relies on classicRedirect.timestamp/dismissed that are present in the NVP payload today. For users whose classicRedirect data only contains the existing timestamp/dismissed fields (i.e., no dismissedReasons), this hook now always returns false, so the “Switch to Classic” flow will prompt the survey every time even if they completed it within the last 30 days.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
classicRedirect.dismissedReasons should always exist if user has filled the survey form so comment is not as useful 👎
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 9.2.71-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.71-5 🚀
|
Explanation of Change
Fixed Issues
$ #73156
PROPOSAL: #73156 (comment)
Tests
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
ANDROID.mov
Android: mWeb Chrome
WEBSITE.ANDROID.mov
iOS: Native
IOS.mov
iOS: mWeb Safari
WEBSITE.IOS.mov
MacOS: Chrome / Safari
WEBSITE.mov
MacOS: Desktop
DESKTOP.mov