Releases: nozzlegear/ShopifySharp
ShopifySharp.Extensions.DependencyInjection 1.4.0
What's Changed
Dynamic factory service registration via IServiceFactory<T>
A pull request by @adearriba refactored ShopifySharp's service factory classes so that they all use a common IServiceFactory<T>
interface to implement their factory methods. This is then used to dynamically register all service factories in ShopifySharp when you use services.AddShopifySharp()
or services.AddShopifySharpServiceFactories()
.
Pull requests
- Added IServiceFactory + Refactor DI by @adearriba in #1010
Full Changelog: ShopifySharp.Extensions.DependencyInjection/1.3.0...ShopifySharp.Extensions.DependencyInjection/1.4.0
ShopifySharp 6.12.2
What's Changed
Bug fixes
This release fixes a bug with the ShopifyOauthUtility.RefreshAccessTokenAsync
method, which was disposing the static HttpClient in ShopifySharp's InternalHttpClientFactory. If the developer did not supply their own IHttpClientFactory to the ShopifyService via ShopifyService.SetHttpClientFactory
, then any service that attempted to call the Shopify API after the disposal would throw an ObjectDisposedException
for the lifetime of the application.
Note: because the deprecated AuthorizationService.RefreshAccessTokenAsync
calls the ShopifyOauthUtility
behind the scenes, it was also affected by this bug.
More info about this bug can be found in #1005.
Pull requests
- Fix disposal of InternalHttpClientFactory's static HttpClient by @nozzlegear in #1006
Full Changelog: ShopifySharp/6.12.1...ShopifySharp/6.12.2
ShopifySharp 6.12.1
What's Changed
Bug fixes
Reported in #1001 and fixed in #1002 where the CloneableRequestMessage
underlying all request execution policies would fail to clone the request's content if the request wasn't sending JsonContent
. In practice, this only affected the PartnerService, GraphService, and any service that derived from them, and only if the requests were cloned on a retry in the execution policy.
Also reported in #1001 and fixed in #1002 was a bug affecting the LeakyBucketExecutionPolicy
and RetryExecutionPolicy
, where the original request were accidentally disposed before the policies could retry them if they had received an unsuccessful response. This would result in the policies throwing an ObjectDisposedException
.
Repository changes
ShopifySharp's documentation has a new home thanks to @Laurabee530! Where before all of the documentation for the package was crammed into the main readme – which made for a very long scroll – you can now find the documentation for each individual service in ShopifySharp's wiki here on Github.
Pull requests
- Update readme.md by @Laurabee530 in #994
- Fix #1001 CloneableRequestMessage fails to clone content and throws ObjectDisposed exception by @nozzlegear in #1002
New Contributors
- @Laurabee530 made their first contribution in #994
Full Changelog: ShopifySharp/6.12.0...ShopifySharp/6.12.1
ShopifySharp 6.12.0
What's Changed
Bug fixes
A bug was fixed in #997 that could cause the ShopifyDomainUtility.IsValidShopDomainAsync
method to erroneously return true in cases where the response contained an X-ShopId
header with an empty value. (#995)
ShopifyException refactoring
The following changes were made to the exception classes in ShopifySharp:
- Introduced a new exception type named
ShopifyHttpException
, which inherits from the baseShopifyException
. This new exception should be thrown whenever an http request fails or returns an error. - Made the
ShopifyRateLimitException
inherit from theShopifyHttpException
. - Deprecated most HTTP properties on the base
ShopifyException
:HttpStatusCode
RequestId
Errors
RawBody
- Removed the deprecated
ShopifyException.HttpResponse
property. - Refactored the base
ShopifyService
,GraphService
andPartnerService
classes to throw aShopifyHttpException
where applicable. - Removed a custom error message that was injected into the
ShopifyException.Errors
string list in some cases. This error message was an exact duplicate of the exception's message.
Leaky Bucket Execution Policy and Retry Execution Policy enhancements
Added small enhancements to the Leaky Bucket execution policy and the Retry execution policy to make them retry certain common request http request failures. I've based this code off of the retry policy found in Microsoft's Azure.Core SDK (MIT licensed), though it's not quite a one-to-one match since we don't have the concept of an HTTP pipeline in ShopifySharp.
These are the status codes that will be retried if a request fails in the Leaky Bucket and Retry execution policies:
case 408: // Request Timeout
case 429: // Too Many Requests
case 500: // Internal Server Error
case 502: // Bad Gateway
case 503: // Service Unavailable
case 504: // Gateway Timeout
The policies will retry these requests up to three times before throwing a ShopifyHttpException
.
Importantly, the default behavior of the Leaky Bucket and Retry policies should remain intact -- they won't start retrying additional responses unless you opt-in to the behavior by using the new constructor overloads on each policy. I wanted to make this change available for testing and feedback right now, so I can gather some feedback on it.
Pull requests
- Exception refactoring by @nozzlegear in #996
- Fix X-ShopId header check when header value is empty by @nozzlegear in #997
- Enhanced retry strategies for Leaky Bucket and Retry policies by @nozzlegear in #998
Full Changelog: ShopifySharp/6.11.0...ShopifySharp/6.12.0
ShopifySharp 6.8.3
What's Changed
- Add missing ProductServiceFactory by @nozzlegear in #981
- Add InventoryLevel.AdminGraphQLAPIId by @clement911 in 5a43e57
Full Changelog: ShopifySharp/6.8.2...ShopifySharp/6.8.3
ShopifySharp.Extensions.DependencyInjection 1.1.1
What's Changed
- Add IProductServiceFactory to DI container by @nozzlegear in #982
Full Changelog: ShopifySharp.Extensions.DependencyInjection/1.1.0...ShopifySharp.Extensions.DependencyInjection/1.1.1
ShopifySharp 6.8.2
What's Changed
This release is just a small version bump to take ShopifySharp from 6.8.0 to 6.8.2, so that an unlisted/erroneous 6.8.1 version that was released two months ago on Nuget will not accidentally be installed due to package versioning rules.
Full Changelog: ShopifySharp/6.8.0...ShopifySharp/6.8.2
ShopifySharp 6.8.0
What's Changed
- Extracted logic to parse Bucket state information for REST and GraphQL by @clement911 in #970
- Using SystemTextJson instead of JsonNet to extract leaky bucket state… by @clement911 in #972
- Added Order.SourceIdentifier by @clement911 in #974
- Rename ShopifyRestApiCredentials to ShopifyApiCredentials by @nozzlegear in #977
- Deprecate ShopifyException.HttpResponseMessage property by @nozzlegear in #978
- Deprecate AuthorizationService and split it into separate utility classes with interfaces by @nozzlegear in #976
- Add
factory.Create(string shopDomain, string accessToken)
overload to all service factories by @nozzlegear in #979
Full Changelog: ShopifySharp/6.7.0...ShopifySharp/6.8.0
ShopifySharp.Extensions.DependencyInjection 1.1.0
What's Changed
- Add
services.AddShopifySharpUtilities
by @nozzlegear in #980
Full Changelog: ShopifySharp.Extensions.DependencyInjection/1.0.0...ShopifySharp.Extensions.DependencyInjection/1.1.0
ShopifySharp 6.7.0
What's Changed
- More robust validation when setting leaky bucket state. by @clement911 in #955
- Handle GraphQL API bucket state bug. by @clement911 in #956
- Regenerated the GraphQL model to expose the IConnectionWithEdges<TNod… by @clement911 in #958
- Fixes #957 by @clement911 in #961
- New overload to GraphService.Send to allow passing variables + unit t… by @clement911 in #966
- Added missing 'Currency' property to 'Charge' entity. by @ltasler in #967
- Add service factory classes for all ShopifySharp services by @nozzlegear in #963
- Add method to validate Shopify webhooks using
ReadOnlyMemory<byte>
by @Socolin in #969 - Add ShopifySharp.Entities.WebhookPayloads.CartUpdatedPayload object by @nozzlegear in #964
New Contributors
Full Changelog: 6.6.1...ShopifySharp/6.7.0