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

chore: prepend version mismatch to GraphQL errors #3580

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

petertonysmith94
Copy link
Contributor

@petertonysmith94 petertonysmith94 commented Jan 13, 2025

Release notes

In this release, we:

  • Removed warning for incompatible node version in favour of prepending the warning to GQL errors.

Summary

  • Before, we warned users (via console) of incompatibilities with the fuel-core node version on Provider instantiation. This could often lead to misinterpretation of issues.
  • Now, we prepend any error messages thrown from GraphQL, with the same incompatibility message.

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@petertonysmith94 petertonysmith94 added the chore Issue is a chore label Jan 13, 2025
@petertonysmith94 petertonysmith94 self-assigned this Jan 13, 2025
Copy link

vercel bot commented Jan 13, 2025

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

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 11:00am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 11:00am
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 11:00am

@petertonysmith94 petertonysmith94 changed the title chore: reconsider version mismatch chore: prepend version mismatch to GraphQL errors Jan 13, 2025
Copy link
Contributor

@Torres-ssf Torres-ssf left a comment

Choose a reason for hiding this comment

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

@petertonysmith94 Should we also remove the warning here?

if (/^\d+\.\d+\.\d+\D+/m.test(networkVersion)) {
// eslint-disable-next-line no-console
console.warn(`You're running against an unreleased fuel-core version: ${networkVersion}. Things may work as expected, but it's not guaranteed. Please use a released version.
This unreleased fuel-core build may include features and updates not yet supported by this version of the TS-SDK.`);
}

@petertonysmith94
Copy link
Contributor Author

petertonysmith94 commented Jan 14, 2025

@petertonysmith94 Should we also remove the warning here?

if (/^\d+\.\d+\.\d+\D+/m.test(networkVersion)) {
// eslint-disable-next-line no-console
console.warn(`You're running against an unreleased fuel-core version: ${networkVersion}. Things may work as expected, but it's not guaranteed. Please use a released version.
This unreleased fuel-core build may include features and updates not yet supported by this version of the TS-SDK.`);
}

@Torres-ssf I believe this is only a warning for when using unofficial versions of fuel-core, which I haven't seen any instance of (doesn't conform to a semver versioning).

I'd say this one is alright to leave in.

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
77.04%(+0.02%) 70.64%(+0.03%) 75.1%(-0.03%) 77.04%(+0.01%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/provider.ts 68.55%
(+0%)
58.46%
(+0.09%)
69.89%
(+0%)
68.28%
(+0%)
🔴 packages/account/src/providers/utils/handle-gql-error-message.ts 90%
(+2.5%)
83.33%
(+3.33%)
80%
(-20%)
86.36%
(-2.52%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reconsider version mismatch warning
4 participants