Error when throttling on dynamic windows

Hello,

I get this error when using throttling (Hangfire.Throttling 1.4.2 on dotnet 10) on a Redis database.

System.InvalidOperationException: Dynamic Window 'mobileiron:application' doesn't exist. Use ThrottlingManager.AddOrUpdateDynamicWindow method to add Dynamic Window.
   at Hangfire.Throttling.DynamicWindowAttribute.TryAcquire(ElectStateContext context, Int64 timestamp, JobStorageConnection connection, TimeSpan& minimumDelay)
   at Hangfire.Throttling.ThrottlingAttribute.TryAcquireThrottlers(ElectStateContext context, IEnumerable`1 throttlers, ICollection`1& failedThrottlers)
   at Hangfire.Throttling.ThrottlingAttribute.AcquireThrottlers(ElectStateContext context)
   at Hangfire.States.StateMachine.InvokeOnStateElection(KeyValuePair`2 x)

altough it exists :

Here is how I call it :
[DynamicWindow(“mobile_iron”, “metrics”)]
public async Task ExecuteAsync(

So is it possible somewhere in my upgrade of package, the normalization of the window id had a broken change ? (in the logs it’s mobileiron instead of mobile_iron).
Or that the ‘_’ is trimmed but only on the attribute creating a mismatch ?

Hello @sncf-pedro-de-rycker ,

Thank you for reporting this, this is a regression related to dynamic windows, appeared in 1.4.2. Please downgrade to version 1.4.1 to fix the issue, and I will release the fix for this problem as soon as possible.

I have identified the problem and committed the fix, the new version is expected to be released tomorrow.

The new version is ready, please see Hangfire.Throttling 1.4.3. Let me know if you have any troubles!

Thanks for the fast fix :wink: