You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indeed, OnReload() is always reloaded in the VaultChangeWatcher, so it should trigger OnChange() in IOptionsMonitor. I've fixed this in the upcoming release. Please note that it checks the version of data in Vault, not the actual values.
RunAsync should not be awaited, it has a Join method that blocks the calling thread.
I hope my fix resolves your issue. I'm planning to do a release asap.
Regarding my 2nd point, I think it's more of a semantic issue, it's always logging that the key is outdated because secretData.SecretData.Metadata.Version == currentVersion; is false for secretData.SecretData.Metadata.Version > currentVersion;. That's why I suggested implementing 3 states, instead of 2, for cases when a (current version) cached key is found.
Describe the bug
When using IOptionsMonitor in combination with this library, its OnChange always seems to trigger, even if there are no changes to the configuration.
And I know it's not entirely related to this issue, but the README mentions that sometimes values don't reload and show old/empty values (dotnet/runtime#37860). I was not able to reproduce that issue. Could it be related to the RunAsync not being awaited and the configuration simply not being there yet (https://github.com/MrZoidberg/VaultSharp.Extensions.Configuration/blob/master/Source/VaultSharp.Extensions.Configuration/VaultConfigurationProvider.cs#L80)?
To Reproduce
I've reproduced the issue in this repo: https://github.com/Reintjuu/hashicorp-vault-dotnet-example.
Expected behaviour
OnChange should only trigger when there is an actual change to the configuration.
The text was updated successfully, but these errors were encountered: