Skip to content
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

Onyx Bump 2.0.48: null -> undefined changes #20

Conversation

chrispader
Copy link
Member

@chrispader chrispader commented May 31, 2024

@mountiny

Details

Requires Expensify/react-native-onyx#556 to get merged first!

Requires Expensify/react-native-onyx#558 to get merged first

Part of the Onyx bump to 2.0.43 in Expensify#42772

This PR applies all the changes needed to work with Onyx version 2.0.43. This will be mostly changing types, default values and null-handling for output by Onyx.

Fixed Issues

$
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed 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 added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • 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: mWeb Chrome
    • iOS: Native
    • iOS: mWeb 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 any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • 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 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 a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • 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 PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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.

Screenshots/Videos

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

@chrispader chrispader changed the title [WIP] Onyx Bump 2.0.43: null -> undefined changes Onyx Bump 2.0.43: null -> undefined changes May 31, 2024
@chrispader chrispader changed the title Onyx Bump 2.0.43: null -> undefined changes [HOLD on react-native-onyx#556] Onyx Bump 2.0.43: null -> undefined changes May 31, 2024
@chrispader chrispader changed the title [HOLD on react-native-onyx#556] Onyx Bump 2.0.43: null -> undefined changes Onyx Bump 2.0.43: null -> undefined changes May 31, 2024
@chrispader
Copy link
Member Author

@mountiny this should be ready for review! can we trigger QA on this?

(Note that i had to create the PR in our margelo E/App fork, because both branches or on this fork

@chrispader
Copy link
Member Author

can we trigger QA on this?

If not, i can create a combined PR, with all the changes (also from the base branch) so we can trigger QA, but still review separately

@s77rt
Copy link

s77rt commented May 31, 2024

Looks we have some unrelated commits, can you clean those up?

@chrispader
Copy link
Member Author

Looks we have some unrelated commits, can you clean those up?

@s77rt done! :)

@s77rt

This comment was marked as outdated.

@s77rt
Copy link

s77rt commented May 31, 2024

On first render the header is missing

Screen.Recording.2024-06-01.at.12.36.29.AM.mov

@s77rt
Copy link

s77rt commented May 31, 2024

First time submitting an expense getting an empty view

Screen.Recording.2024-06-01.at.12.39.27.AM.mov

@s77rt
Copy link

s77rt commented May 31, 2024

Emoji suggestion not working

Screen.Recording.2024-06-01.at.12.43.04.AM.mov

@s77rt
Copy link

s77rt commented May 31, 2024

Infinite loader on attachments and not loading in chats

Screen.Recording.2024-06-01.at.12.55.10.AM.mov

@chrispader chrispader changed the title Onyx Bump 2.0.43: null -> undefined changes Onyx Bump 2.0.44: null -> undefined changes Jun 2, 2024
@chrispader
Copy link
Member Author

Fixing these issues in Expensify/react-native-onyx#558

@chrispader
Copy link
Member Author

On first render the header is missing

Fixed in Expensify/react-native-onyx#558

@ikevin127
Copy link

@s77rt Try logging out, deleting all keys in Inspect > Application > IndexedDB > OnyxDB > keyvaluepairs and refresh the login page after doing that. Now login normally and you should not get the empty report screens anymore (that's what worked for me).

@chrispader
Copy link
Member Author

@s77rt Try logging out, deleting all keys in Inspect > Application > IndexedDB > OnyxDB > keyvaluepairs and refresh the login page after doing that. Now login normally and you should not get the empty report screens anymore (that's what worked for me).

@ikevin127 @s77rt i just changed a lot of parts of the app and this (☝🏼) is actually what fixes a lot of issues. For me, everything works fine now. Please continue with QA and let me know if there are any other issues.

When we deploy this Bump PR, it would probably be best to force a sign-out for all users and clear the database, because a lot of data might be stale (null values in storage instead of undefined) which might cause problems.

@ikevin127
Copy link

ikevin127 commented Jun 6, 2024

✅ Issues reported by other testers and triaged as fixed:

⚠️ Issues found today during overall app testing:

Important

All these were cross-tested on latest staging (v1.4.79-10) where none of them are reproducible.
They only occur on this PR with the Expensify/react-native-onyx#558 changes applied as per #20 (comment).

    • Nested Thread back button navigation shows Hmm... it's not here page

      False alarm, this was caused by Fix get all ancestors in a thread Expensify/App#42554.

      Component source: ThreadDivider.tsx

      Steps:

      1. Navigate to a report and post a message.
      2. Hover over the sent message and press Reply in thread.
      3. Post a message within the thread.
      4. Repeat step 2 and 3 such that you have a 3-level nested thread.
      5. Navigate to the 2nd or 3rd level of the thread and press on the Screenshot 2024-06-05 at 17 16 04 button such that you're navigated back out of the nested thread.

      Expected result: We're navigated back out of the nested thread of which Screenshot 2024-06-05 at 17 16 04 button we pressed.
      Actual result: We're shown the Hmm... it's not here - You don't have access to this chat report screen.

      Video
      Screen.Recording.2024-06-05.at.17.mp4

To be continued...

@chrispader
Copy link
Member Author

chrispader commented Jun 6, 2024

There's a bug which is reproducible on main that hinders me from testing the issues related to "Submit expense" and uploading a receipt (and changing the Date).

I cannot get around this issue. Does anybody of you experience the same issue and/or is this already reported somewhere? @ikevin127 @s77rt

https://drive.google.com/file/d/1MbNUZAUG_1ZnffRp6LychNuQZPlHmA3S/view?usp=share_link

(couldn't upload this screen recording here, because it's too big)

@s77rt
Copy link

s77rt commented Jun 6, 2024

Tested again and now I'm seeing the report but the header is gone

Screenshot 2024-06-06 at 2 50 20 PM

@s77rt
Copy link

s77rt commented Jun 6, 2024

Can you merge Onyx:main into margelo:@chrispader/fix-onyx-bump-fixes

@s77rt
Copy link

s77rt commented Jun 6, 2024

The submit expense to a user is still empty in my testing
Screenshot 2024-06-06 at 3 18 15 PM

@s77rt
Copy link

s77rt commented Jun 6, 2024

The split details too
Screenshot 2024-06-06 at 3 20 43 PM

@chrispader
Copy link
Member Author

chrispader commented Jun 6, 2024

@s77rt i think i found the solution for us (me and @ikevin127) not being able to reproduce your issues. I just had the same issues as you.

The problem is, that we recently migrated withOnyx in Onyx to TypeScript. Because we moved lib/withOnyx.js to lib/withOnyx/index.ts, there will now be duplicate built JS files for withOnyx in your local dist folder. Webpack will therefore pick the old dist/withOnyx.js file instead of dist/withOnyx/index.ts

Removing your dist folder in your local Onyx, running npm run build:watch and then npx link publish <path_to_onyx> should fix all those issues.

@s77rt
Copy link

s77rt commented Jun 6, 2024

@chrispader That's a great find! Indeed that was the issue!

@chrispader
Copy link
Member Author

At the moment it seems all issues with this PR are resolved. @mountiny

@s77rt issues are fixed by the instructions in the last comment

The "Going back on threads" issue reported by @ikevin127 is also reproducible on staging, as in Expensify#43172

I'm gonna wait for further testing results from you guys, until then i'm gonna focus on some other tasks.

@s77rt
Copy link

s77rt commented Jun 7, 2024

Been testing this for a while didn't find any bug yet

@chrispader chrispader changed the title Onyx Bump 2.0.44: null -> undefined changes Onyx Bump 2.0.47: null -> undefined changes Jun 7, 2024
@chrispader chrispader merged commit 29ce13f into @chrispader/after-revert-bump-onyx-to-2-0-42 Jun 7, 2024
8 of 14 checks passed
@chrispader chrispader changed the title Onyx Bump 2.0.47: null -> undefined changes Onyx Bump 2.0.48: null -> undefined changes Jun 15, 2024
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.

3 participants