Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Stacked on #96. Replaces #91.
useReportIDToNameMaprebuilt the whole map in every consumer on every report write, and each consumer re-rendered with a new object. It now reads the reports through@hooks/useOnyxStateand builds the map once per report collection, shared by every consumer. Most report writes, such as a new message or a read marker, change no name. In that case the map of the previous collection is reused, so consumers keep the same reference and do not re-render.This is the first consumer of the
useOnyxStatewrapper, so it also shows how a selector with a module-level cache has to be written. Inside Search the selector receives the reports of the Search snapshot and elsewhere the live reports, and both kinds of consumer can be mounted at once. The cache is therefore keyed by the collection, and the comparison with the previous reports usespreviousState, which goes through the same redirect. A cache that holds only the last input would be thrown away on every switch between the two sources.Fixed Issues
$
PROPOSAL:
Tests
#admins.Offline tests
Same as tests. Mentions of rooms already loaded keep rendering offline.
QA Steps
Same as tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari