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

feat: Add retry and retryDelay Properties to Enhance Download Method Reliability #734

Merged
merged 7 commits into from
Oct 15, 2024

Conversation

hexboy
Copy link
Contributor

@hexboy hexboy commented Sep 5, 2024

Summary

This PR introduces two new properties, retry and retryDelay, to the ScriptConfig within the download method. These properties aim to improve the download process by handling network failures more robustly.

  • retry: Specifies the number of attempts to retry the download in case of failure.
  • retryDelay: Defines the delay (in milliseconds) between each retry attempt.

This feature aims to minimize the impact of transient network failures and improve the reliability of downloads in unstable network conditions.

Test plan

Copy link

changeset-bot bot commented Sep 5, 2024

🦋 Changeset detected

Latest commit: 564018a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@callstack/repack Minor
@callstack/repack-dev-server Minor
@callstack/repack-init Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
repack-website ⬜️ Ignored (Inspect) Visit Preview Oct 15, 2024 11:46am

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

hi @hexboy, thanks for another contribution!

I've reviewed the PR and left some comments there. On a side-note, I think that we could do a lot of this on JS-side only - all we need is to check if the error from native loadScript is related to fetching data - WDYT?

@jbroma
Copy link
Member

jbroma commented Sep 29, 2024

hey @hexboy, do you want to work on this PR or should we take this over? It's definitely something that we want to have in the next major (5.0) release. Either way your contribution is very much appreciated!

@hexboy
Copy link
Contributor Author

hexboy commented Sep 29, 2024

Hey @jbroma, I'll start working on rewriting the entire PR in JavaScript. I estimate it will take one or two days to complete.

Since I don't see any existing native unit tests in the project, and there may be a need to add a new native module or package, I'm not planning to write native tests for this.

@jbroma
Copy link
Member

jbroma commented Sep 30, 2024

Hey @jbroma, I'll start working on rewriting the entire PR in JavaScript. I estimate it will take one or two days to complete.

glad to hear that!

Since I don't see any existing native unit tests in the project, and there may be a need to add a new native module or package, I'm not planning to write native tests for this.

yeah, let's not worry about native tests for now 👍

@hexboy
Copy link
Contributor Author

hexboy commented Oct 4, 2024

Hey @jbroma, I just rewrote the entire PR in JavaScript. Please check it again.

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

thanks for rewriting this in JS! Looks good overall, few nits there and there, take a look 👇

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

All looks good now 🎉 Let's fix the failing tests by not testing the protected method in the tests and instead, test loadScript directly there since it's exposed as a public interface 👍

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@jbroma jbroma merged commit b455503 into callstack:main Oct 15, 2024
4 checks passed
@jbroma
Copy link
Member

jbroma commented Oct 15, 2024

Thank you for working on this @hexboy, much appreciated! 👏 🚀

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