Closed joemiller closed 11 years ago
ping. @amdprophet @portertech . would like to get this reviewed and merged if it's ok. or, if this is not the right fix then something else. But in our case we've been running it for a few weeks and it fixes the issue with results never clearing from the board.
I'll take a look at noon and get this dealt with today. I have a feeling there's a better fix but I haven't found it yet.
Hey guys!
A friend of mine was having a similar issue and he asked me to help him debugging it. I found the bug and after I came to here and saw this PR.
Actually the problem is that in the initialize method the List is listening to the 'remove' event
and renderEmpty() has declared the wrong parameters order
as you can see from Backbone documentation.
And when the event is fired that exception occurs.
So, maybe the right fix is to create a new function with the correct parameters to listen to the remove event and then call renderEmpty() passing it the second parameter (collection).
(Dropbox is having issues by serving the files. Try to refresh the browser if the 3 images doesn't load.)
That is most definitely the issue. Working on a fix now.
@joemiller I think this should fix it - can you give it a shot? https://github.com/amdprophet/sensu-dashboard/commit/2d22d9a244de946761415c868f1048b09a81aa66
still breaks when item is removed
On Mon, Apr 22, 2013 at 2:12 PM, Justin Kolberg notifications@github.comwrote:
@joemiller https://github.com/joemiller I think this should fix it - can you give it a shot? amdprophet@2d22d9ahttps://github.com/amdprophet/sensu-dashboard/commit/2d22d9a244de946761415c868f1048b09a81aa66
— Reply to this email directly or view it on GitHubhttps://github.com/sensu/sensu-dashboard/pull/127#issuecomment-16824204 .
I think @listenTo(@collection, "add", @render)
will fail as well.
"add" (model, collection, options) — when a model is added to a collection.
@amdprophet I think the patch you referenced fixes it. It's working for me now. I was mistaken before, I had a previously defined breakpoint in chrome from 3 weeks ago that I forgot about and was trying to signal an error to me :( Sorry for the confusion.
@joemiller no problem. I'm going to make a similar fix to the "add" listener as @jamesdphillips suggested and then I'll open a new PR.
@amdprophet @jamesdphillips Any fixes hanging around?
Pull Request #137 has a fix. @kdaniels - are you able to test #137 and see if it fixes the issue for you?
@amdprophet I tested #137 and I no longer see the null object error in the dev console and the event count updates automatically, but the event list still does not.
@kdaniels if you have any dashboard settings (aside from credentials) can you gist them? What browser & browser version are you using? Do you have any extensions that could be affecting JavaScript and/or AJAX requests? Are you on the latest sensu & sensu-dashboard? I'll try to replicate the same scenario you're getting over the weekend.
@amdprophet I'm seeing this in both Safari 6.0.5 and Chrome 28.0.1500.71, with all extensions disabled. I'm running sensu 0.10.0 and dashboard 0.9.9. The only settings I've got are https://gist.github.com/kdaniels/2a95ab40c04126d4b9d4
as discussed on irc, i believe this fixes an error that causes refreshing the events table to stop working if an event is removed between updates.
the error in the console is:
Uncaught TypeError: Object #<Event> has no method 'isEmpty'