Skip to content

fix chat section not updating#637

Merged
youssef-lr merged 4 commits intoExpensify:mainfrom
huult:61584-chat-section-not-updating
May 22, 2025
Merged

fix chat section not updating#637
youssef-lr merged 4 commits intoExpensify:mainfrom
huult:61584-chat-section-not-updating

Conversation

@huult
Copy link
Copy Markdown
Contributor

@huult huult commented May 20, 2025

Details

Updated logic to return full value if the key doesn't exist in the snapshot, ensuring new keys are correctly preserved in newValue.

Related Issues

Expensify/App#61584

Automated Tests

Manual Tests

  1. Open the Expensify app.
  2. Open any chat.
  3. Send a message.
  4. Navigate to the "Reports" screen.
  5. Tap on the dropdown menu and select "Chats".
  6. Open the chat where you just sent the message.
  7. Send a few more messages in that chat.
  8. Tap the arrow on the top left corner to return to "Chats".
  9. Observe that the message list is not updated.
  10. Navigate to a different section (e.g., Home).
  11. Return to the "Chats" screen.
  12. Observe that the message list is now updated.
  13. Verify that the message list on "Chats" should automatically update after sending more messages.

Author Checklist

  • I linked the correct issue in the ### Related Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

@huult huult requested a review from a team as a code owner May 20, 2025 01:31
@melvin-bot melvin-bot Bot requested review from Julesssss and removed request for a team May 20, 2025 01:32
@huult huult marked this pull request as draft May 20, 2025 02:04
@huult huult marked this pull request as ready for review May 20, 2025 02:52
Copy link
Copy Markdown
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But assigning @youssef-lr as it's related to this

@Julesssss Julesssss requested a review from youssef-lr May 20, 2025 22:56
@akinwale
Copy link
Copy Markdown

@huult You have not implemented unit tests here as specified in your proposal. You'll need to update your PR with unit tests.

cc @youssef-lr

@huult
Copy link
Copy Markdown
Contributor Author

huult commented May 21, 2025

@akinwale sure

@dmkt9
Copy link
Copy Markdown

dmkt9 commented May 21, 2025

I know there's nothing that can be changed. But he used my solution. That's quite funny. Expensify/App#61584 (comment)

@huult
Copy link
Copy Markdown
Contributor Author

huult commented May 21, 2025

I know there's nothing that can be changed. But he used my solution. That's quite funny. Expensify/App#61584 (comment)

Screenshot 2025-05-21 at 20 14 22

Here is my comment to ask C+ what I should do, since I was hired by the internal team (@youssef-lr ).

@dmkt9 Please respect that I didn't use your solution. I was investigating while making the PR and found a more suitable approach. I will ask C+ to understand the next steps—whether a change proposal is needed or what happened. I THINK YOU SHOULD RESPECT OTHERS BEFORE SAYING SOMETHING LIKE THIS. IT'S NOT FUNNY.

I asked C+ whether they decided to change the solution or what I should do. I'm waiting for their response, and if there are any changes, they will post them so we are informed.

One more thing—I think before you say anything, you should consider and please respect others. Thanks!

cc @akinwale @youssef-lr

@dmkt9
Copy link
Copy Markdown

dmkt9 commented May 21, 2025

@huult You can say whatever you want. But in the issue thread, you and I argued quite a bit about it.

@youssef-lr youssef-lr merged commit 3f79832 into Expensify:main May 22, 2025
5 checks passed
@os-botify
Copy link
Copy Markdown
Contributor

os-botify Bot commented May 22, 2025

🚀 Published to npm in 2.0.107 🎉

@huult
Copy link
Copy Markdown
Contributor Author

huult commented May 22, 2025

@youssef-lr Can I continue with this task and create a PR to upgrade the version of react-native-onyx in the Expensify repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants