Skip to content

map-reducer: catch invalid timestamps  #260

@tyrasd

Description

@tyrasd

Describe the bug

Currently, when one supplies invalid datetime strings to the timestamps method of the map-reudcer (e.g. .timestamps("foo", "bar")), no exception is thrown immediately. Instead, this ends up in unspecified behaviour "down the road": the contribution view may throw null pointer exceptions, while the snapshot view simply ignores the invalid times and returns empty results.

Here's one part of the problem: unparseable timestamps are just ignored:

LOG.error("Unable to parse timestamp string, skipping: " + e.getMessage());

To fix, the .timestamps method (and/or the OSHDBTimestamps class) should check if the supplied timestamps are valid and parsable.

this bug was found by @rtroilo

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as expected

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions