mozilla / firefox-code-coverage-frontend

The Firefox code coverage diff viewer allows determining code coverage changes for added lines per changeset.
https://firefox-code-coverage.herokuapp.com/
Mozilla Public License 2.0
9 stars 19 forks source link

TypeError: p.to is undefined #197

Open jankeromnes opened 6 years ago

jankeromnes commented 6 years ago

The coverage front-end is broken on this revision: https://firefox-code-coverage.herokuapp.com/#/changeset/04dd259d71db60341016eccf53ced43742319631

The error is TypeError: p.to is undefined. Webpack and Devtools are not getting along well, but a simple git grep in the sources seems to point to:

https://github.com/mozilla/firefox-code-coverage-frontend/blob/a5f48df591ea46901234270e002ee01983d164c6/src/utils/data.js#L130

Adding logging on all these p variables (whatever they are) shows this problem:

// "usual" p:
{
  "chunks": [
    // ... lots of data ...
  ],
  "deletions": 22,
  "additions": 7,
  "from": "media/libcubeb/0002-Always-upmix-mono-to-the-first-two-channels-if-enoug.patch",
  "to": "media/libcubeb/0002-Always-upmix-mono-to-the-first-two-channels-if-enoug.patch"
}

// "defective" p that breaks the front-end:
{
  "chunks": [],
  "deletions": 2,
  "additions": 2,
  "from": ""
}

@armenzg should we simply skip ps that don't have a .to attribute?

armenzg commented 6 years ago

Sure.

This could be a bug in parse-diff for the mentioned revision.