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

[$250] Storybook stuck loading #36937

Closed
6 tasks
pecanoro opened this issue Feb 20, 2024 · 13 comments
Closed
6 tasks

[$250] Storybook stuck loading #36937

pecanoro opened this issue Feb 20, 2024 · 13 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@pecanoro
Copy link
Contributor

pecanoro commented Feb 20, 2024

Regression from PR: #35552

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number:
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers): n/a
Logs: https://stackoverflow.com/c/expensify/questions/4856 n/a
Expensify/Expensify Issue URL: n/a
Issue reported by: @getusha and @pecanoro
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1708428340426319

Action Performed:

Run npm run storybook

Expected Result:

Storybook to properly load in http://localhost:6006/

Actual Result:

UI skeleton is only loaded and console error returns:

image

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify
@pecanoro pecanoro added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 20, 2024
Copy link

melvin-bot bot commented Feb 20, 2024

Triggered auto assignment to @mallenexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@pecanoro
Copy link
Contributor Author

As discussed here, @getusha will fix it!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 20, 2024
@getusha
Copy link
Contributor

getusha commented Feb 20, 2024

Raised the PR

This comment was marked as resolved.

@pecanoro pecanoro assigned pecanoro and unassigned cristipaval Feb 20, 2024
@omarnagy91
Copy link

Proposal

Please re-state the problem that we are trying to solve in this issue.

The problem we are trying to solve in this issue is that the Storybook UI is not loading properly and is only displaying a UI skeleton. The console error message is not provided, but it is likely related to an infinite loop or performance issue caused by the useEffect hook in the MyComponent component.

What is the root cause of that problem?

The root cause of the problem is that the useEffect hook in the MyComponent component does not have a dependency array. This means that the effect runs every time the component renders, which can lead to infinite loops and performance issues.

What changes do you think we should make in order to solve the problem?

To solve the problem, we should add a dependency array to the useEffect hook that includes the locale variable. This will ensure that the effect only runs when the locale variable changes.

Code Solution

import React, {useEffect} from 'react';
import {StyleSheet, Text} from 'react-native';
import {LocaleContext} from '@root/LocaleContextProvider';
import type {Locale} from '@types/Locale';
import CONST from '@src/CONST';

const styles = StyleSheet.create({
    text: {
        fontSize: 14,
    },
});

const MyComponent = (props) => {
    const {locale} = React.useContext(LocaleContext);

    useEffect(() => {
        // For example, if we want to fetch data based on a user's locale:
        if (locale) {
            const localeCode = CONST.SUPPORTED_LOCALES[locale].code;
            // Make network request here using localeCode
        }
    }, [locale]);

    const someFunction = (translatedText) => {
        // For example, a function that takes the user's locale into account
        // to translate text
        return translatedText;
    };

    return (
        
    );
};

export default MyComponent;

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 21, 2024
@mallenexpensify
Copy link
Contributor

@omarnagy91 please review CONTRIBUTING.md

Available jobs are the one's with the Help Wanted label.

Copy link

melvin-bot bot commented Mar 4, 2024

@pecanoro, @mallenexpensify, @getusha, @aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Mar 6, 2024

@pecanoro, @mallenexpensify, @getusha, @aimane-chnaif Still overdue 6 days?! Let's take care of this!

@getusha
Copy link
Contributor

getusha commented Mar 6, 2024

This is ready for payout @mallenexpensify, automation didn't trigger on this one.

@mallenexpensify mallenexpensify added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Mar 10, 2024
@mallenexpensify
Copy link
Contributor

mallenexpensify commented Mar 10, 2024

Thanks @getusha , whole lotta automation missed here :/

@getusha , @aimane-chnaif , can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~017343d0b98ad711bc

@melvin-bot melvin-bot bot removed the Overdue label Mar 10, 2024
@getusha
Copy link
Contributor

getusha commented Mar 11, 2024

@mallenexpensify accepted, thanks!

Copy link

melvin-bot bot commented Mar 12, 2024

@pecanoro @mallenexpensify @getusha @aimane-chnaif this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@mallenexpensify
Copy link
Contributor

Contributor: @getusha paid $250 via Upwork
Contributor+: @aimane-chnaif paid $250 via Upwork

Closing, no regression test needed, not customer facing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

6 participants