-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Not here error appears briefly when enabling features #40650
Not here error appears briefly when enabling features #40650
Conversation
@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 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid.movAndroid: mWeb ChromemAndroid.moviOS: Nativeios.moviOS: mWeb SafarimSafari.movMacOS: Chrome / Safarichrome.movMacOS: Desktopdesk.mov |
For more context, the conversation from old PR is here: |
if (!isFocused) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZhenjaHorbach Can you elaborate about this one?
This one will cause regression, because in some feature screens, we still have the modal screen, ie: CategoryDetail.
So if we opened CategoryDetail screen and disabled the category feature, we will only see the NotFoundScreen after we dismiss the modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evidence:
Screen.Recording.2024-04-22.at.14.36.09.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm
Good catch
Actually I think we can remove this condition
Because it was one of the options to get rid of setTimeout from my previous implementation
But now I tested without this condition
And it seems to work well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still didn't work, please make sure you test it carefully.
Screen.Recording.2024-04-22.at.16.14.35.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned few test cases already, please make sure it will test all these cases.
#39443 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the video for all cases
zapis-ekrana-2024-04-22-v-114038_PvYQVrKb.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
✋ 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: 1.4.66-0 🚀
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.4.66-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.66-5 🚀
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid casts (as
), it should be a last resource in exceptional cases, we have typescript because we want type safety and this breaks it.
const policyFeatureStates = useMemo( | ||
() => ({ | ||
[CONST.POLICY.MORE_FEATURES.ARE_DISTANCE_RATES_ENABLED]: policy?.areDistanceRatesEnabled, | ||
[CONST.POLICY.MORE_FEATURES.ARE_WORKFLOWS_ENABLED]: policy?.areWorkflowsEnabled, | ||
[CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED]: policy?.areCategoriesEnabled, | ||
[CONST.POLICY.MORE_FEATURES.ARE_TAGS_ENABLED]: policy?.areTagsEnabled, | ||
[CONST.POLICY.MORE_FEATURES.ARE_TAXES_ENABLED]: policy?.tax?.trackingEnabled, | ||
[CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED]: policy?.areConnectionsEnabled, | ||
}), | ||
[policy], | ||
) as PolicyFeatureStates; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, my fault
I agree that this is a mistake
const newFeatureStates = {} as PolicyFeatureStates; | ||
(Object.keys(policy?.pendingFields ?? {}) as PolicyFeatureName[]).forEach((key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should always avoid casting (as
) since it breaks type safety. Was it really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case it make sense
Because Object.keys always returns string[]
Which in this case breaks the typing inside the callback
Details
Fixed Issues
$ #39443
PROPOSAL: #39443 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-04-14.at.23.35.34.mov
Android: mWeb Chrome
Screen.Recording.2024-04-14.at.23.35.34.mov
iOS: Native
Screen.Recording.2024-04-14.at.23.39.27.mov
iOS: mWeb Safari
Screen.Recording.2024-04-14.at.23.39.27.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-14.at.23.33.41.mov
MacOS: Desktop
Screen.Recording.2024-04-14.at.23.37.30.mov