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

PKG -- [fcl-core] Remove unnecessary config overload #1911

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

jribbink
Copy link
Contributor

@jribbink jribbink commented Jun 14, 2024

Closes #1913

This config.overload call is never used because prepTemplateOpts actually generates the Cadence code itself from the tempalte anyways (i.e. this operation is not handled by conventional FCL import replacement from config).

Not sure if this is something old that slipped through and was just never used, or what the case here.

More broadly though, we should not be modifying the configuration object internally. It should serve as user configuration & we should try to avoid using it as global state. Particularly, config.overload can be deceiving as it executes an async function, meaning that when the inner function yields control to the event loop it could mean that this overloaded config can leak into another execution context (i.e. via this shared global state).

@jribbink jribbink requested a review from a team as a code owner June 14, 2024 06:20
Copy link

changeset-bot bot commented Jun 14, 2024

🦋 Changeset detected

Latest commit: 8eca819

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

This PR includes changesets to release 4 packages
Name Type
@onflow/fcl-core Patch
@onflow/fcl-react-native Patch
@onflow/fcl-wc Patch
@onflow/fcl Patch

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

@jribbink jribbink force-pushed the jribbink/fix-wc-error branch from 539fdec to 8eca819 Compare June 14, 2024 16:20
@jribbink jribbink changed the title PKG -- [fcl] Remove unnecessary config overload PKG -- [fcl-core] Remove unnecessary config overload Jun 14, 2024
@jribbink jribbink requested a review from nialexsan June 14, 2024 17:19
Copy link
Contributor

@nialexsan nialexsan left a comment

Choose a reason for hiding this comment

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

that was a weird flow with overloading the config midway through the run

@jribbink jribbink merged commit 6ca1353 into master Jun 14, 2024
1 check passed
@jribbink jribbink deleted the jribbink/fix-wc-error branch June 14, 2024 18:19
@github-actions github-actions bot mentioned this pull request Sep 27, 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.

FCL showing false WalletConnect configuration changed errors when sending transactions
2 participants