microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.98k stars 1.47k forks source link

429: Rate limit issue when using codePush(MyApp) HOC wrapper #2622

Closed imanshul closed 6 months ago

imanshul commented 11 months ago

How to avoid the Rate limit warning which is reporting issue in Firebase when HOC is used to download codepush?

I have below code in my App.js which is a functional component while App.js is further connected using

AppRegistry.registerComponent(appName, () => codePush(BuildProperties.getCodePushOptions())(App));

codePush.sync(
            BuildProperties.getCodePushOptions(),
            (status) => {
                if (!BuildProperties.showCodePushUpdate())
                    return;

                switch (status) {
                    case codePush.SyncStatus.CHECKING_FOR_UPDATE:
                        setUpdateText(Strings.checkingUpdate);
                        break;
                    case codePush.SyncStatus.DOWNLOADING_PACKAGE:
                        setUpdateText(Strings.downloadingUpdate);
                        break;
                    case codePush.SyncStatus.INSTALLING_UPDATE:
                        setUpdateText(Strings.installingUpdate);
                        break;
                    default:
                        break;
                }
            },
            (progress) => {
                if (!BuildProperties.showCodePushUpdate())
                    return;

                console.log(progress.receivedBytes + " of " + progress.totalBytes + " received.");
                let percentageProgress = parseInt(parseFloat((progress.receivedBytes / progress.totalBytes)).toFixed(2) * 100)
                setUpdateText(percentageProgress + '% downloaded');
                setCodepushProgress(percentageProgress)
            }
        ).then((response) => {
            console.log('codepush-syncstatus:', response);
        }).catch((error) => {
            //Actual codepush error will occur here 429 -> Rate limit is exceeded
            setUpdateInProgress(false)
            console.log('Error performing CodePush sync:', error);
        });
MikhailSuendukov commented 9 months ago

Hi @imanshul could you please confirm what this issue still persist on latest version (8.2.1)

microsoft-github-policy-service[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

microsoft-github-policy-service[bot] commented 6 months ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.