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

Handling of validation errors #104

Closed
rdeltour opened this issue Oct 9, 2019 · 6 comments
Closed

Handling of validation errors #104

rdeltour opened this issue Oct 9, 2019 · 6 comments

Comments

@rdeltour
Copy link
Member

rdeltour commented Oct 9, 2019

The processing algorithm currently says:

User agents SHOULD NOT include in their internal representation any value that generates a validation error.

I'm not sure what this means.

My expectation would be that the algorithm itself defines precisely (I think it does, to be double-checked) what term is created (or not) when a value causes a validation error. In which case we don't need the statement above?

Unless I'm missing something, I'd be in favor of just removing this statement.

@llemeurfr
Copy link
Contributor

I agree with Romain. The internal representation is expanded from the json representation and specified in the spec for the benefit of interoperability, but it is the json representation which is validated via a json schema.

@mattgarrish
Copy link
Member

My expectation would be that the algorithm itself defines precisely (I think it does, to be double-checked) what term is created (or not) when a value causes a validation error.

Not for all values. If something is invalid, or not specified, and there is a default, that default may get swapped in.

But if a date, for example, doesn't exactly match the ISO spec format, you can't replace it with anything. Is it worth completely tossing the property just for that reason?

But given the nature of our manifest, most data is harmless, so I personally don't care if we drop the statement. It might look stupid presented to a user, but their browser won't burst into flames.

@rdeltour
Copy link
Member Author

rdeltour commented Oct 9, 2019

But if a date, for example, doesn't exactly match the ISO spec format, you can't replace it with anything. Is it worth completely tossing the property just for that reason?

Yes, IMO.
In that case, the spec could say that the UA must either convert the data to an ISO date using UA-defined logic (in order to allow for clever UAs with good natural language processing), or return undefined.

@mattgarrish
Copy link
Member

Yes, IMO.

Wow, you're harsh... ;)

But I suppose in a sense that's fine, too. If we're going to be reasonably strict about metadata in the core being for processing/user configurability, then we probably need to be less lenient about invalid data.

I don't really have a strong opinion one way or the other, though, to be honest.

mattgarrish added a commit that referenced this issue Oct 10, 2019
fix some links referencing the wrong infra definitions;
fix some phrasing to better reflect the infra spec
@mattgarrish
Copy link
Member

I updated #103 last night to ignore/remove properties with invalid values.

@iherman
Copy link
Member

iherman commented Oct 15, 2019

@rdeltour, with the merge of #103, I have closed this issue. If you think there is still something to discuss, reopen it!

@iherman iherman closed this as completed Oct 15, 2019
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

4 participants