Releases: nozzlegear/ShopifySharp
ShopifySharp 6.18.0
Summary
ShopifySharp v6.18.0 is now available on Nuget! This release updates our target Shopify API version to 2024-07. You can upgrade ShopifySharp using the dotnet CLI – dotnet add package shopifysharp --version 6.18.0
– or with your IDE's package manager UI. Once you upgrade ShopifySharp, don't forget to upgrade your Shopify webhook API version in the Partner dashboard to match.
What's changed
- All service classes now use API version 2024-07, as noted above.
- All GraphQL entities in the
ShopifySharp.GraphQL
namespace have been regenerated based on Shopify's 2024-07 GraphQL schema. - Added a new
Transaction.AdjustmentReason
property. - Added new
DeliveryMethod.ServiceCode
,DeliveryMethod.SourceReference
,DeliveryMethod.BrandedPromise
andDeliveryMethod.AdditionalInformation
properties. - Deprecated the
CountryService
,CountryServiceFactory
and related interfaces. Shopify has deprecated the REST API's Country endpoint, and they recommend developers migrate to the Storefront GraphQL API as an alternative. - Removed deprecated
Order.ProcessingMethod
property. - Removed deprecated
FulfillmentServiceEntity.FulfillmentOrdersOptIn
property. Fulfillment Orders are now the only processing method for fulfillment services and fulfilling orders in general, so there is no more concept of "opting in" to fulfillment orders. - Removed deprecated
ShopifyException
http properties. If you used. these properties, you should be able to switch all of yourcatch (ShopifyException ex) where (ex.StatusCode)
to(ShopifyHttpException ex) where (ex.StatusCode)
. - Moved
ShopifyHttpException
into theShopifySharp
namespace for consistency. - Added a default exception message for
ShopifyExponentialRetryCanceledException
.
These changes should only affect you if you've created your own class that extends one of ShopifySharp's services, or if you've created a custom IRequestExecutionPolicy
:
- Removed deprecated
RequestResult.Response
property. If you need access to the response status code, you should be able to useRequestResult.StatusCode
instead. - Removed deprecated
ShopifyService.PrepareRequest
method. This was replaced withShopifyService.BuildRequestUri
. - Removed deprecated
ShopifyService.BuildShopUri
method. This was replaced withIShopifyDomainUtility.BuildShopDomainUri
. - Removed deprecated
CloneableRequestMessage.Clone
method. This was replaced withCloneableRequestMessage.CloneAsync
.
Full Changelog: ShopifySharp/6.17.0...ShopifySharp/6.18.0
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp 6.16.1
Summary
ShopifySharp v6.16.1 is a small release that addresses a potential memory leak bug with undisposed cloneable request messages inside the new ExponentialRetryPolicy
. Depending on the way you've configured the policy's options, the policy could eventually run your application out of memory as it held onto each request and woudld never let new ones attack.
What's Changed
- fix: Dispose cloned request messages in
ExponentialRetryPolicy
by @nozzlegear in #1069
Full Changelog: ShopifySharp/6.16.0...ShopifySharp/6.16.1
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp 6.16.0
Summary
This release introduces a new request execution policy for ShopifySharp called ExponentialRetryPolicy
! As the name suggests, this policy is responsible for making requests to Shopify's API, and then introducing an exponential delay between the last failure and the next time it tries to send the request. The exponential delay is on a per-request basis, so there's no attempt to be "smart" in this policy or to perform any sort of lookup on the access token being used or the leaky bucket status.
You can configure the new policy using the ExponentialRetryPolicyOptions
class:
var policyOptions = new ExponentialRetryPolicyOptions
{
InitialBackoffInMillseconds = 50,
MaximumDelayBetweenRetries = TimeSpan.FromSeconds(1),
MaximumTriesBeforeRequestCancellation = null,
MaximumDelayBeforeRequestCancellation = TimeSpan.FromSeconds(5)
};
Note that MaximumTriesBeforeRequestCancellation
and MaximumDelayBeforeRequestCancellation
are both nullalbe, but one of them is in fact required and will be validated when the policy is constructed.
Alongside the new policy, this release also adds the RequestResult.StatusCode
property, which should make it a simple matter to grab the response's status code in custom IRequestExecutionPolicy
"middleware" without relying on the deprecated (and soon to be removed) HttpPRequestMessage
object.
Finally, there's a small change that most won't noticed in this pull request unless you've got your own custom IRequestExecutionPolicy
. The return result types of RequestResult.GetRestBucketState
and RequestResult.GetGraphQLBucketState
were changed to be nullable. This does not actually change the underlying implementation – the methods could always return null, the types were simply updated to reflect that fact.
Changelog
- Add RequestResult.StatusCode property by @nozzlegear in #1063
- Make RequestResult bucket state return types nullable, plus misc refactoring by @nozzlegear in #1066
- Feature: Retry policy with exponential delay by @nozzlegear in #1065
Full Changelog: ShopifySharp/6.15.1...ShopifySharp/6.16.0
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp.Extensions.DependencyInjection 1.6.0
Summary
ShopifySharp.Extensions.DependencyInjection 1.6.0 adds support for ShopifySharp's new ExponentialRetryPolicy
. Since this is the first policy that requires or supports any kind of configuration, the package has been updated to add defaults for those options to DI when the policy has been added but the options have not. You can override those defaults by supplying your own options:
var policyOptions = new ExponentialRetryPolicyOptions
{
InitialBackoffInMillseconds = 50,
MaximumDelayBetweenRetries = TimeSpan.FromSeconds(1),
MaximumTriesBeforeRequestCancellation = null,
MaximumDelayBeforeRequestCancellation = TimeSpan.FromSeconds(5)
};
services.AddSingleton(policyOptions);
services.AddShopifySharp<ExponentialRetryPolicy>();
If you don't supply any configuration options, the package will use ExponentialRetryPolicyOptions.Default
instead.
Changelog
- Feature: Retry policy with exponential delay by @nozzlegear in #1065
Full Changelog: ShopifySharp.Extensions.DependencyInjection/1.5.0...ShopifySharp.Extensions.DependencyInjection/1.6.0
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp 6.15.1
Summary
This release fixes a nasty bug in ShopifySharp's LeakyBucketExecutionPolicy
which could cause canceled requests to build up and never be dequeued. If the execution policy was sufficiently swamped (e.g. by a webhook endpoint or just very active usage), then the wait time between requests would increase continuously until each request is waiting potentially 5, 10, 15 minutes between when it enters the queue and when it actually sends. This could lead to OOM exceptions as requests pile up and eventually crash the application, further compounding the problem if this is a webhook endpoint, as Shopify would retry failed requests after 5 seconds.
In addition to that bug fix, this release also adds Product.VariantGids
which can be used to map the REST version of a Shopify product to the Graph version. Remember: Shopify has deprecated the REST API for all product and product-related endpoints, which means eventually we'll all need to migrate to the GraphQL API if we want to work with products.
Changelog
- Added product.variant_gids by @clement911 in #1061
- Fix LeakyBucket cancellation token timeout and memory leak bug by @nozzlegear in #1057
Full Changelog: ShopifySharp/6.15.0...ShopifySharp/6.15.1
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp 6.15.0
Summary
ShopifySharp 6.15.0 has been released and published to Nuget! This release updates our Shopify API version target from 2024-01 to 2024-04. Once you upgrade ShopifySharp, you'll want to make sure you update your Shopify webhook API version in your Partner dashboard to match!
Here's a quick rundown of the things that have changed in this release along with the new API version:
- Added
ShippingLine.IsRemoved
- Regenerated all
ShopifySharp.GraphQL
entities to match the 2024-04 graph schema. - Marked the
CheckoutService
andOrderRiskService
classes as obsolete. Shopify has deprecated all checkout REST APIs in favor of their storefront cart APIs. - The
FulfillmentService.FulfillmentOrdersOptIn
property has been marked obsolete. This property was deprecated by Shopify, as all fulfillment services have already been opted in to fulfillment orders.
You can download the latest version of ShopifySharp from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp
.
Changelog
- Upgraded lib to API 2024-04 by @clement911 in #1060
Full Changelog: ShopifySharp/6.14.1...ShopifySharp/6.15.0
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp 6.14.1
Summary
ShopifySharp 6.14.1 is a minor release which added two authorization scope enums, in addition to making the ShopifyHttpException.RequestInfo
property a nullable string.
You can download the latest version of ShopifySharp from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp
.
Changelog
- ReadReturns and WriteReturns authorization scopes by @arsuceno in #1053
- Make ShopifyHttpException.RequestInfo a nullable string by @nozzlegear in #1056
Full Changelog: ShopifySharp/6.14.0...ShopifySharp/6.14.1
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp.Extensions.DependencyInjection 1.5.0
Summary
This is a new release for ShopifySharp.Extensions.DependencyInjection, bumping the version up to 1.5.0. You can now set the service lifetime when registering ShopifySharp with Microsoft's DI container:
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped;
services.AddShopifySharp<MyRequestExecutionPolicy>(serviceLifetime);
Previously, all services were registered as a singleton and you had no control over the lifetime.
You can download the latest version of ShopifySharp.Extensions.DependencyInjection from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp.extensions.dependencyinjection
.
What's Changed
New Contributors
Full Changelog: ShopifySharp.Extensions.DependencyInjection/1.4.0...ShopifySharp.Extensions.DependencyInjection/1.5.0
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp 6.14.0
Summary
This release bumps ShopifySharp's version up to 6.14.0, containing several bugfixes, new entities, and new fields for existing entities. You can download the latest version of ShopifySharp from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp
.
New features and services
- Added
ShopifyPaymentsDisputeEvidence
entities by @dsargent9182 in #1025 - Added new fields on
Transaction
entity by @clement911 in #1016 - Added
ShopifyHttpException.RequestInfo
by @clement911 in #1022
Bug fixes
- Added missing SendAsync missing methods to the
IGraphService
interface by @adearriba in #1015 - Use built-in REST API limit header retrieval by @clement911 in #1018
- Handle cases where rate limit header is not available by @clement911 in #1019
⚠️ MakeCheckoutLineItem.Id
a string by @nozzlegear in #1048
Miscelleneous changes
- Add code to skip failing tests that go into infinite loop by @clement911 in #1034
- Update readme.md by @VincentMatthews in #1043
New Contributors
- @dsargent9182 made their first contribution in #1025
- @VincentMatthews made their first contribution in #1043
- @19bibo85 made their first contribution in #1042
Full Changelog: ShopifySharp/6.13.0...ShopifySharp/6.14.0
How to support ShopifySharp
If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.
ShopifySharp 6.13.0
What's Changed
Shopify API Version 2024-01
This release now targets version 2024-01 of Shopify's API! Previously, ShopifySharp was targeting version 2023-07. We've regenerated the GraphQL classes accordingly, so be prepared for breaking changes if you use any of the Graph objects that Shopify has changed in their latest API.
Deprecations
The deprecated CustomerSavedSearchService
has been removed in this release. Shopify recommends that you use the GraphQL Customer Segment API instead.
Pull requests
- Release 2024-01 by @nozzlegear in #1011
Full Changelog: ShopifySharp/6.12.2...ShopifySharp/6.13.0