-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Fix] Workspace - Inconsistent workspace subtitle when approver is changed in offline mode #56770
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
[Fix] Workspace - Inconsistent workspace subtitle when approver is changed in offline mode #56770
Conversation
@mananjadhav 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] |
@@ -139,10 +139,6 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) { | |||
}, [personalDetails, reports]); | |||
|
|||
const initializeOptions = useCallback(() => { | |||
if (areOptionsInitialized.current) { |
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.
Would this cause any performance impact?
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.
Good question! The way I see it is the following - this functionality was missing, and it needed to be added, so the app can function properly, it's not like we are compounding the performance of an existing functionality, we are adding one.
Previously, these options would only be initialized on the very first render of the MoneyRequestParticipantsList
and stay that way until you relog/restart, ignoring changes made to the reports/policies made by you and others.
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.
Yeah I don't have the best context on this one, so hence I am checking. May be @grgia could take a look as 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.
I don't have the full context on why we needed this initially
src/libs/OptionsListUtils.ts
Outdated
const submitToAccountID = getSubmitToAccountID(policy, report); | ||
const submitsToAccountDetails = allPersonalDetails?.[submitToAccountID]; | ||
const subtitle = submitsToAccountDetails?.displayName ?? submitsToAccountDetails?.login; | ||
const subtitle = getChatRoomSubtitle(report, {isCreateExpenseFlow: true}); |
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 am just trying to understand if something can break with the case with!subtitle || !config.isCreateExpenseFlow
?
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.
You're right, I'm reverting that change
@@ -92,6 +92,12 @@ function MoneyRequestParticipantsSelector({participants = CONST.EMPTY_ARRAY, onF | |||
searchInServer(debouncedSearchTerm.trim()); | |||
}, [debouncedSearchTerm]); | |||
|
|||
useEffect(() => { |
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.
does it cause any extra rerender? Do we have a way to check this?
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.
Based on my testing, this just adds a function call
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.
Small comments. I'll also check if this PR solves the empty subtitle issue.
@mananjadhav I checked and it looks like this PR won't solve #56609, it must be something else |
🚧 @grgia has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
I am still testing this. Will have this completed before Monday. |
I did a basic test on the web. But I need to test this more across all platforms, which I will get done by today/tomorrow |
…7-inconsistent-workspace-subtitle
@mananjadhav I just updated the branch with the latest main, let me know if there's anything you'd like me to change here! |
I'll have the checklist updated today |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-submits-to-offline.movAndroid: mWeb Chromemweb-chrome-submits-to-offline.moviOS: Nativeios-submits-to-offline.moviOS: mWeb Safarimweb-safari-submits-to-offline.movMacOS: Chrome / Safaridesktop-submits-to-offline.movMacOS: Desktopweb-submits-to-offline.mov |
In the videos you'll notice an unrelated Mapbox error due to some keys. It's a problem with my local setup. |
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, As long as there are no major performance regressions, should be good to go
✋ 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/grgia in version: 9.1.7-1 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.7-2 🚀
|
Explanation of Change
The options list has to be initialized on each render of
MoneyRequestParticipantsSelector
in order to reflect the latest changes, including changing the approver.Fixed Issues
$ #56507
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as Tests section above.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
MacOS: Chrome / Safari
web-compressed.mov