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

Error about duplicate properties in manifest.json #803

Closed
kumar303 opened this issue Jun 30, 2016 · 8 comments
Closed

Error about duplicate properties in manifest.json #803

kumar303 opened this issue Jun 30, 2016 · 8 comments
Assignees
Milestone

Comments

@kumar303
Copy link
Contributor

The linter should show a warning (or error?) if a manifest has duplicate properties in it. This will lead to confusing results when the JSON is parsed by Firefox (I think the last one wins). Example:

{
  "name": "My Extension",
  "name": "My Extension 2",
  "version": "1.0"
}
@tofumatt
Copy link
Contributor

Oh, good call. I think a straight up error is appropriate here.

  • tofumatt

On 30 June 2016 at 22:43:25, Kumar McMillan ([email protected])
wrote:

The linter should show a warning (or error?) if a manifest has duplicate
properties in it. This will lead to confusing results when the JSON is
parsed by Firefox (I think the last one wins). Example:

{
"name": "My Extension",
"name": "My Extension 2",
"version": "1.0"
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#803, or mute the thread
https://github.com/notifications/unsubscribe/AAFi923pOkEnOx4BuDNm5vVnzswDibnTks5qRDh9gaJpZM4JCnxn
.

@tofumatt tofumatt self-assigned this Jul 1, 2016
@tofumatt tofumatt added this to the 50.2 milestone Jul 1, 2016
@tofumatt tofumatt changed the title Warn about duplicate properties in manifest.json Error about duplicate properties in manifest.json Jul 1, 2016
@tofumatt
Copy link
Contributor

tofumatt commented Jul 1, 2016

Doing some research it seems this is totally allowed by the JSON spec (though not recommended, it is technically allowed) and most parsers (PHP, node, Python) just replace the value of the key whenever it hits a new one.

That said, we can check for duplicate keys pretty easily with JSON.parse's reviver parameter, so I'll get this done today! 😄

@ValentinaPC
Copy link

I was able to upload WebExtensions with duplicate keys in manifest, without any issues:

  • a WebExtension with 2 "name" keys (the name of the WebExtension after submissions was the second)
  • a WebExtension with 2 "versions" keys (the version of the WebExtension after submission was the second aka the last one)

Verified using FF47 and FF50 (Win 7).
Screenshots:
2016-07-05_1055
2016-07-05_1108

@ValentinaPC ValentinaPC reopened this Jul 5, 2016
@muffinresearch
Copy link
Contributor

@ValentinaPC This might not be released yet. When a patch lands in addons-linter it takes a package release and a lib bump in addons-server to be at a point ready to test.

@ValentinaPC
Copy link

I saw this closed... so... I've tested! 😄

@muffinresearch
Copy link
Contributor

muffinresearch commented Jul 5, 2016

@ValentinaPC it's worth noting there'll always be a delay between closure and it being possible to test for every single addons-linter PR. We need to figure a better way to communicate that.

@tofumatt got any thoughts on how we can make it clearer for addons-linter that there's a dependency on an npm release and a corresponding package bump in addons-server? Maybe we need an unreleased label or similar? Bonus points if it's automated and changes automatically when addons-servers package.json contains a version with a given patch.

@tofumatt
Copy link
Contributor

tofumatt commented Jul 5, 2016 via email

@andymckay
Copy link

This works for me. Closing, if you want to do something about notifications about when we push, please make that a seperate bug.

screenshot 2016-07-20 16 20 49

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

6 participants