Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent un-quoting of quoted strings upon parse #190

Closed
Aaronontheweb opened this issue Jan 22, 2020 · 0 comments · Fixed by #191
Closed

Inconsistent un-quoting of quoted strings upon parse #190

Aaronontheweb opened this issue Jan 22, 2020 · 0 comments · Fixed by #191
Labels
akkadotnet-compat Legacy compatibility with Akka.Configuration bug
Milestone

Comments

@Aaronontheweb
Copy link
Member

Version 1.3.1

A legacy issue with some of the HOCON code we call in Akka.NET....

Unparsed HOCON:

adapters {
      gremlin = "Akka.Remote.Transport.FailureInjectorProvider,Akka.Remote"
      trttl = "Akka.Remote.Transport.ThrottlerProvider,Akka.Remote"
    }

Stand-alone parsed HOCON:

{[gremlin, "Akka.Remote.Transport.FailureInjectorProvider,Akka.Remote"]}
{[trttl, "Akka.Remote.Transport.ThrottlerProvider,Akka.Remote"]}

Akka.Configuration parsed HOCON:

{[gremlin, Akka.Remote.Transport.FailureInjectorProvider,Akka.Remote]}
{[trttl, Akka.Remote.Transport.ThrottlerProvider,Akka.Remote]}

HOCON C# Code

Adapters = ConfigToMap(config.GetConfig("akka.remote.adapters"));

private static IDictionary<string, string> ConfigToMap(Config cfg)
        {
            if(cfg.IsEmpty) return new Dictionary<string, string>();
            var unwrapped = cfg.Root.GetObject().Unwrapped;
            return unwrapped.ToDictionary(k => k.Key, v => v.Value != null? v.Value.ToString():null);
        }

The ultimate bug here is that the strings are still internally quoted in this respository's version of the HOCON parser, while they are correctly unquoted in the original Akka.NET parser.

@Aaronontheweb Aaronontheweb added bug akkadotnet-compat Legacy compatibility with Akka.Configuration labels Jan 22, 2020
@Aaronontheweb Aaronontheweb added this to the 1.3.2 milestone Jan 22, 2020
Aaronontheweb added a commit to Aaronontheweb/HOCON that referenced this issue Jan 23, 2020
Aaronontheweb added a commit to Aaronontheweb/HOCON that referenced this issue Jan 23, 2020
Aaronontheweb added a commit that referenced this issue Jan 23, 2020
* added reproduction spec for #190

* close #190 - fix was to call GetString, rather than ToString

* added comment to clarify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
akkadotnet-compat Legacy compatibility with Akka.Configuration bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant