imranmomin / Hangfire.AzureCosmosDb

Azure Cosmos DB storage provider for Hangfire
https://www.hangfire.io/
MIT License
18 stars 17 forks source link

Breaking change in Microsoft.Azure.Cosmos 3.17.0 breaks the Hangfire.Azure.CosmosDbConnection. #12

Closed bzumhagen closed 3 years ago

bzumhagen commented 3 years ago

Scenario: Trying to get or create a recurring job

Expected: Call to Hangfire.RecurringJobExtensions.GetOrCreateRecurringJob succeeds

Actual:

Application startup exception: System.MissingMethodException: Method not found: 'System.Linq.IOrderedQueryable`1<!!0> Microsoft.Azure.Cosmos.Container.GetItemLinqQueryable(Boolean, System.String, Microsoft.Azure.Cosmos.QueryRequestOptions)'.
   at Hangfire.Azure.CosmosDbConnection.GetAllEntriesFromHash(String key)
   at Hangfire.RecurringJobExtensions.GetOrCreateRecurringJob(IStorageConnection connection, String recurringJobId, ITimeZoneResolver timeZoneResolver, DateTime now)
   at Hangfire.RecurringJobManager.AddOrUpdate(String recurringJobId, Job job, String cronExpression, RecurringJobOptions options)

It looks like like this commit: https://github.com/Azure/azure-cosmos-dotnet-v3/commit/ecce6cfb71a44a1883bb24979e881c6a6a17587a introduced a breaking contract change in Microsoft.Azure.Cosmos 3.17.0.

Workaround is to use Microsoft.Azure.Cosmos 3.16.0 or lower.

Suggest to support the new signature or put a dependency guard to indicate that it's not compatible with Microsoft.Azure.Cosmos =< 3.17.0

imranmomin commented 3 years ago

The project was upgraded to use Microsoft.Azure.Cosmos 3.18.0