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

Wait until notification types are loaded #3537

Merged
merged 1 commit into from Feb 23, 2017

Conversation

Projects
None yet
3 participants
@edmundoa
Member

edmundoa commented Feb 22, 2017

In order to easily reproduce the issue, I manually added a Thread.sleep(1000) in org.graylog2.rest.resources.alarmcallbacks.AlarmCallbacksResource#available.

Fixes #3534

This needs to be merged into the 2.2 branch as well.

@edmundoa edmundoa modified the milestones: 2.3.0, 2.2.2 Feb 22, 2017

@dennisoelkers dennisoelkers self-assigned this Feb 23, 2017

@dennisoelkers

dennisoelkers requested changes Feb 23, 2017 edited

While this might work, the problem is not solved in the place where it occurs. The race condition occurs in the AlertNotification component, so it should also be solved there, because otherwise it will happen again when that component is rendered from a different component. There are (at least) two ways to solve it there:

a) pass the alert notification type to the AlertNotification component as a prop, or
b) use the store in that component and wait for it to load, rendering a spinner in the mean time.

@edmundoa edmundoa force-pushed the issue-3534 branch from d9b8a56 to e18d711 Feb 23, 2017

@edmundoa

This comment has been minimized.

Member

edmundoa commented Feb 23, 2017

I moved the check to the component itself. The reason to put it in ConditionAlertNotifications before was because that component is the one requesting the data, and it feels more natural to me to group those two actions that are closely related.

@dennisoelkers dennisoelkers merged commit 0a3b881 into master Feb 23, 2017

4 checks passed

ci-web-linter Jenkins build graylog-pr-linter-check 1379 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details

@dennisoelkers dennisoelkers deleted the issue-3534 branch Feb 23, 2017

dennisoelkers added a commit that referenced this pull request Feb 23, 2017

Wait until notification types are loaded (#3537)
Fixes #3534
(cherry picked from commit 0a3b881)

kroepke added a commit that referenced this pull request Feb 23, 2017

@joschi joschi modified the milestones: 2.3.0, 2.2.2 Mar 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment