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

Elm App History Export Corrupted in some 0.19 apps #1799

Open
arsduo opened this issue Sep 15, 2018 · 1 comment
Open

Elm App History Export Corrupted in some 0.19 apps #1799

arsduo opened this issue Sep 15, 2018 · 1 comment

Comments

@arsduo
Copy link

arsduo commented Sep 15, 2018

An example app I use (a slightly expanded version of the counter example) is experiencing a bug with Elm's debug history exports. Compiled with either elm-make or with webpack, clicking the counter buttons a few times and then exporting the history yields malform data like:

{
  "$": 0,
  "a": {
    "metadata": {
      "versions": {
        "elm": "0.19.0"
      },
      "types": {
        "message": "Main.Msg",
        "aliases": {},
        "unions": {
          "Main.Msg": {
            "args": [],
            "tags": {
              "Decrement": [],
              "Increment": [],
              "UpdateSecretField": [
                "String.String"
              ]
            }
          },
          "String.String": {
            "args": [],
            "tags": {
              "String": []
            }
          }
        }
      }
    },
    "history": [
      null,
      null,
      null,
      null,
      null
    ]
  }
}

The export function works fine for @rtfeldman's Elm SPA example, so it must be something subtle about this code, but for the life of me I can't figure it out.

Expected: the history field contains data about the messages that have been received

Actual: each entry is null.

SSCCE: https://github.com/arsduo/elm-history-export-bug

OS/browser: OS X 10.13.6, behavior consistent across Firefox/Chrome/Safari. A colleague was also able to reproduce this using the example on OS X.

elm-history-export-bug
elm-version

@arsduo
Copy link
Author

arsduo commented Jan 22, 2019

FWIW I'm no longer seeing that problem -- instead, the history entries are being exported without the constructors.

For instance, I'm getting this:

{
  "history": [
    {
      "$": "Just",
      "a": "{\"authToken\":{\"access_token\":\"MY_TOKEN\"}}"
    }
  ]
}

instead of

{
  "history": [
    {
      "$": "StoredUserCredentialsRetrieved",
      "a": {
        "$": "Just",
        "a": "{\"authToken\":{\"access_token\":\"MY_TOKEN\"}}"
      }
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant