Skip to content

Commit

Permalink
Fixing relative time range used by RecentMessageLoader. (#4513)
Browse files Browse the repository at this point in the history
The RecentMessageLoader component is trying to limit the range of the
search request it used to get the last received message of an input to
the last hour. For this, it uses the `range` parameter. This is the
correct parameter name for the backend, but the web interface uses a
small conversion helper that expects the parameter to be named
`relative` for relative time ranges, according to the naming in the old
web interface.

To make the fix as small as possible for a point release, this change
just uses the `relative` parameter. For `master` and subsequent releases
we should either switch over to the `range` parameter or use it in case
the `relative` parameter is not present. This way we do not discourage
consumers of the `UniversalSearchStore` to use the actually correct
parameter naming.

Fixes #4510.
  • Loading branch information
dennisoelkers authored and bernd committed Jan 24, 2018
1 parent b029269 commit 9229fd3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const RecentMessageLoader = React.createClass({
}
this.setState({ loading: true });
const promise = UniversalSearchStore.search('relative', `gl2_source_input:${inputId} OR gl2_source_radio_input:${inputId}`,
{ range: 3600 }, undefined, 1, undefined, undefined, undefined, false);
{ relative: 3600 }, undefined, 1, undefined, undefined, undefined, false);
promise.then((response) => {
if (response.total_results > 0) {
this.props.onMessageLoaded(response.messages[0]);
Expand Down

0 comments on commit 9229fd3

Please sign in to comment.