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

Wait until notification types are loaded #3537

Merged
merged 1 commit into from Feb 23, 2017
Merged

Wait until notification types are loaded #3537

merged 1 commit into from Feb 23, 2017

Conversation

edmundoa
Copy link
Contributor

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
Copy link
Member

@dennisoelkers dennisoelkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

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
@dennisoelkers dennisoelkers deleted the issue-3534 branch February 23, 2017 16:15
dennisoelkers pushed a commit that referenced this pull request Feb 23, 2017
kroepke pushed 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants