-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[HOLD] Reduce iOS slowness by removing draftComment subscription #3169
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
Conversation
|
||
export default withOnyx({ | ||
draftMessage: { | ||
key: ({reportID, action}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${reportID}_${action.reportActionID}`, |
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.
@yuwenmemon I'm not sure if this would improve things much but we could try subscribing to all the drafts just once in ReportActionsView
under the key
draftMessages: {
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS,
},
then pass the draftMessage
as a prop like
const key = `${${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${reportID}_${reportActionID}}`;
const draftMessage = this.props.draftMessages[key];
...
<ReportActionItem
draftMessage={draftMessage}
...
/>
Not sure if this would have any bad effects while in edit mode, but might be something to try.
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.
Just tested on my physical device and confirmed that on this branch with the above changes it takes quite a while after tapping edit comment
for the UI to let you edit the comment, whereas on main it lets you edit immediately
@marcaaron I added the suggestion to this branch and edit comments are working well! Decided to push it up since we still keep @Jag96's edits intact so I'm sort of confident this should work. I've been riding the struggle bus on being able to test this on a device though. |
Is there a specific error you're seeing? |
Essentially what I reported here: https://expensify.slack.com/archives/C03TQ48KC/p1622245982490700 I tried what Scott suggested, no dice :( |
Posted in the slack thread, we can sort it out there 👍 |
It looks like with the most recent changes to re-enable the draftComment functionality, there is another regression that causes the edit comment UI to take quite a while to show. We're going to hold off on this PR to see if the Onyx Cache updates will help w/ the overall slowness, and come back to it if there are still issues. |
Going to close this since this PR doesn't fix any issues without creating a regression and the onyx PR seems to have sped things up. If we want to optimize onyx subscriptions we can discuss in an issue. |
@marcaaron @yuwenmemon will you please review?
Details
This PR removes a subscription that was making it slower to load chats on iOS. Note: This breaks the draftComment feature, so a fix will have to be implemented to re-introduce that. More context in this issue: #3167 (comment)
Fixed Issues
Fixes #3167
Tests
Note this is much more noticeable on a physical device than it is on simulator
QA Steps
Tested On