Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle unknown index types gracefully in iUtils (#18)
* fix regression in parseTaskId regex when 1b74f29 added support to handle archive tasks, it introduced a new matching group for the regular expression in parseTaskId which shifted the indexing for resulting matches (i.e. m). to simplify things, i am making marking the outer group as don't-capture-just-group (?:) to keep the matching result consistent. as a result, type will be populated using m[3], m[2], or m[1]. m[4] will always be the datsource; m[5] will be the timestamp. this change adds unit tests to demonstrate the expected parseTaskId output for various tasks type supported. it also covers the error case when taskId doesn't match the regular expression. * handle unknown index types gracefully in iUtils this updates parseTaskId in iUtils.coffee which uses a somwhat strict regular expression to parse a given task id and extract type, datasource, and time. this simply removes throwing the error and falls back to 'other' for type leaving dataSource and dataTime alone. in case of a match failure, they would just default to undefined which isn't a blocker to render /indexing-service view.
- Loading branch information