« first day (57 days earlier)      last day (681 days later) » 

1:37 PM
Goal for today: Trac #8 Make SO Chat users appear in the XMPP MUC user list
 
2:21 PM
If anyone has ideas about this project you're welcome to share and/or hack away! If you want a username and password for SVN or Trac, just ask in here or contact me directly.
2
 
3:01 PM
@balpha I had a question for you...
 
hit me
3
 
yesterday I switched how XMPP polls the chat. Previously every user had their own poller for the JSON feed
now, there's only one feed per server (chat.meta.stackoverflow.com, for example)
Originally I gave each XMPP user their own poll because that's how the browser works, and I thought that maybe, once I get authentication working, then the JSOn feed may contain additional information for each user
But it caused some issues. Now my question is, does the JSON feed have information specific to a user if supplied a cookie?
I.E. if someone @The 's me, does that generate a specific JSON event for my session?
Or can I maintain only one feed per server like I am now doing?
 
two things:
a) yes, things like mention events will only be sent to the user who gets mentioned
 
b) if you hit the /events route, you will get the data for all the rooms the user is currently in
 
3:06 PM
that's what I've been doing is using /events
and POSTing r<id> = last value of t I received
for every room ID
but, I do it only once per server, not once per user anymore
 
yeah, that sounds good -- but of course it will only give you the "public" events
 
I think what I will have to do is a mixture of both: the bridge itself polls /events for all users, to get all public events
and each logged in user will also poll /events but I'll only use the user-specific events for them
Is there any way I can have each user's poll not send public events, only their user-specific events? I fear that having every logged in user poll /events will hammer your servers!
 
well, that's what every logged in user does right now -- but HAProxy will ratelimit you pretty quickly if you constantly poll for several users
 
@balpha Maybe the users should poll far less quickly
the bridge itself currently polls every 2sec
maybe user polls should be every 10 or 15 seconds. But then again, I'm not sure what info I'd need from user polls anyway, because things like mention events I'm not sure how to handle via XMPP
 
@TheUnhandledException yeah, that's fine for that one poll -- but if 50 users trust you with their cookies, and you poll on behalf of all of them, all HAProxy sees is a whole bunch of requests from the same IP
 
3:16 PM
Yeah, 50 users will probably be too much, period...
This is I think what was happening to @rchern on Saturday morning
 
say what now?
 
Then, I was polling once per user and the script stopped working after about an hour
6 mins ago, by balpha
well, that's what every logged in user does right now -- but HAProxy will ratelimit you pretty quickly if you constantly poll for several users
 
tavern never worked the first time i tried.
I didn't even get the initial help message.
 
I'll bet my server was ratelimited by HAProxy and that's why The Tavern didn't work... no, that doesn't make sense
because XMPP worked
 
and you had said the script was stopping after a couple hours when it was just you before I connected.
 
3:18 PM
but I think it explains why before the script stopped working after multiple users joined
ok. nevermind. I have no idea what was wrong before :-)
I think I can live without mention events... it would be nice to find a way to handle them, but, since XMPP doesn't really have an equivalent and it will likely cause issues with HAProxy and large numbers of users, I think I'll omit them
Any other user-specific (non public) events you can think of which I might need @balpha ?
 
Probably not. The event types list in in the JS
 
@balpha Cool thanks. I was looking at that earlier since I'm building events today
 
var M = {
        MessagePosted: 1,
        MessageEdited: 2,
        UserEntered: 3,
        UserLeft: 4,
        RoomNameChanged: 5,
        MessageStarred: 6,
        DebugMessage: 7,
        UserMentioned: 8,
        MessageFlagged: 9,
        MessageDeleted: 10,
        FileAdded: 11,
        ModeratorFlag: 12,
        UserSettingsChanged: 13,
        GlobalNotification: 14,
        AccessLevelChanged: 15,
        UserNotification: 16,
        Invitation: 17,
        MessageReply: 18,
        MessageMovedOut: 19,
 
@rchern actually, it's currently called O, not M :)
 
hrmph.
@balpha, by the way, clicking to view the full text results in an exception (;
 
3:26 PM
status-norepro
what exception?
 
> Uncaught TypeError: Cannot read property 'nodeName' of null
(and I get it with the 2 chat extensions disabled too)
 
weird -- honestly, it works fine here
 
I get this error in Firebug:
 
oh, wait -- yeah I see the exception; it's just not critical
i.e. you get to see the full text despite the exception
 
Sure, sure...but having an empty console is nice. (:
 
3:29 PM
Yeah I can see the full text. I don't have a debugger on at the moment (my socks were washed and folded) so I didn't see any exception
@rchern Empty console? When i open the console it's poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll, poll,
gets damn frustrating to try and find my test events, lol
 
heh.
 
joins the party
 
@TimStone Welcome
Got an XMPP/Jabber account @Tim ?
 
I do not
 
You can create one (maybe) on smart-safe-secure.com
Currently we have a 50% success rate ;-)
Just set up your IM client (Pidgin seems to work) to connect to smart-safe-secure.com and choose a username and password, and choose "create this account on the server"
 
3:36 PM
If it doesn't work, I recall register.jabber.org being pretty painless
 
That should work too, and @radp said he had success with Gmail's IM
when you have an account @Tim, join the chat xmpp@msochat.smart-safe-secure.com or the_tavern@msochat.smart-safe-secure.com
 
Alright, cool. Lemme finish up some other stuff before I embark on this adventure, then I'll give it a shot. ;)
 
sure thing, no pressure of course
Finished the other stuff yet and ready to try @Tim? No? Okay... how about now? ;-)
(j/k)
 
"Are we there yet?" Hahah
 
3:40 PM
the exception is happening because an element is removed from the dom from within an event handler bound to that element. is that illegal?
 
@balpha I've never tried that before...
 
@balpha That's... odd. Won't that leave the handler dangling or something?
 
a .live() handler is checking the element if it matches its selector -- but only after a normal .bind() event on the element caused it to be removed from the dom
so it has no parent anymore
 
The poor orphan :(
 
@balpha is orphaning children? how mean. ):
 
3:45 PM
I'm inclined to consider this a jQuery bug... the existence of which would of course mean the end of the universe as we know it
 
"Boy... boy for sale! He's going cheeeeap!"
 
@balpha cowers in fear
 
sometimes auto inserting the user's name is just plain inconvenient.
 
@rchern Agreed.
 
3:46 PM
@balpha Not before the LHC does it, no!
 
@rchern is wrong
 
@balpha So the event on the element that you removed isn't canceled by the handler which removes it? Or is .live() failing to recognize that the event was canceled before trying to perform a selector match?
 
@balpha oy.
@TheUnhandledException, you should unpin old status updates (:
 
@TimStone that's what I'm checking right now
 
Ah, very good then. Please continue. ;)
 
3:48 PM
@rchern Good call
 
okay, if I stop the event from bubbling, at least it will never reach the document, thus not trigger live(), resulting in a clean console
 
makes sense
 
:)
Clean consoles are happy consoles, heh.
 
\o/
clean console from the base code means more room for me to fill up the console (;
 
@rchern That reminds me of bash.org/?4281
 
3:52 PM
Heheh
 
hehe i've seen that before
 
the problem is that I need the event to bubble
so I fear you have to live with that exception :(
 
@balpha Can you defer the remove call?
I don't know what jQuery calls it...
but basically window.setTimeout(function(){ element.remove(); }, 0);
in Prototype.js it would be element.remove.bind(element).defer();
 
I'll probably do that (although I don't need a timeout; I'll just do it in the callback for the AJAX call that's caused by the click handler)
 
jQuery has a .defer() but I haven't used it
 
3:58 PM
@balpha The reason I suggested a timeout was, it moves the code to execute outside the event handler and might solve your problem. Like a separate thread
 
yeah, I got that. But since I'm starting an asynchronous call anyway (the AJAX call), I might as well use that
 
Ah, ok, I see what you mean now
Sorry, coding + chatting == doing neither one well ;-)
 
status-completed
 
did anybody else just see repeated messages through xmpp?
 
yes
 
4:24 PM
@rchern yeah, trying to figure out why
 
@TheUnhandledException In certain edge cases (particularly when deploying, as I just did), the server may send the same event twice. The JS client catches that and ignores these dupe events. Just check if the event id is lower than the last one you saw
 
@balpha Ahhhh, that makes sense
 
Hmm, guess I should prettify a new version of the chat js then eh?
 
@balpha and @rchern (and anyone else), just ask if you want Trac or SVN usernames
 
4:42 PM
I don't know Ruby...and it doesn't look all that fun (;
 
@rchern LOL. I was thinking more Trac access so you can keep my workload up :-)
Actually, I find ruby fun because it's so different from what I'm used to
But you make a good point. No SVN access for you @rchern or else I'll svn update and the code will have switched from Ruby to C# and will be filled with backwards smileys! o:
 
And then I'll come along and convert it to Java and defy you all, mwuahah!
 
hehe Java would be better than Ruby (;
 
@rchern Actually I agree
But, I know Ruby better than Java
Hmmm... every chat event must be tied to a room, right...?
/me thinks
right now I'm polling /events which lists events by room ID, so
 
hmm, some seem like maybe not
UserSettingsChanged? GlobalNotification? AccessLevelChanged?
 
4:49 PM
Those are room events too.
 
@rchern Yeah, good point
@TimStone hmmm
class SOChatEvent
  attr_accessor :server, :room

  def initialize(server=nil,body=nil)
    @server = server
    @room = room
  end
end
 
Even GlobalNotification?
 
(I think, @balpha has to confirm)
 
That's what I have now, but, I think I'm going to change
 
@rchern I think maybe you get one for each room? But, that's a good point..let's see what the code suggests)
 
4:50 PM
class SOChatEvent
  attr_accessor :server

  def initialize(server=nil)
    @server = server
  end
end

class SOChatRoomEvent < SOChatEvent
  attr_accessor :room

  def initialize(server=nil,room=nil)
    @server = server
    @room = room
  end
end
^--> That's how I'll do it
and every chat event will be a child chass of SOChatRoomEvent (for now)
that way, if need be, I can still create events which are not bound to a chat room
 
I'm mildly tempted to do this in Java or C# for the hell of it.
someone distract me quick!
 
Java! ;)
@rchern How do I get the actual height of an element in jQuery? It seems I get the height height, which is not the height..Do the CSS properties return numerical values, or do they include the text units? Although I guess that doesn't matter..
 
@rchern You're certainly welcome to!
I don't mean to monopolize this project by any means
I do agree with @TimStone, Java would be preferable as I have a better chance of being able to continue to contribute :-)
@TimStone I know how to in Prototype.js...
$('element).height(); // returns an int
 
same in jQuery
or is there a nuance about .height() that isn't working for you?
@TheUnhandledException what part of this don't you understand?
6 mins ago, by rchern
someone distract me quick!
 
Oh, I'm just ignorant and didn't think of outerHeight()
 
5:01 PM
ah, yeah that'll add padding/margin/border
 
@rchern This part:
4 mins ago, by The Unhandled Exception
I don't mean to monopolize this project by any means
um
5 mins ago, by The Unhandled Exception
I don't mean to monopolize this project by any means
there we go
nobody likes my choice of language, LOL
 
@TheUnhandledException Per the code, there's the possibility of a response with h## (...host?) instead of r## items, so maybe global notifications appear there... It seems it just iterates over whatever is returned, checking for the event (e) property and then sending each event off to a function that handles everything. In short, seems like your change is a good way to go. :)
 
So, I was being serious @rchern. I don't want you (or anyone else, for that matter) to think this has to be done my way. I am very open to a language change, but, I may not be able to help as much anymore depending on the new language :-)
 
@TimStone, where in the code is this? curious.
 
@TimStone Awesome, thanks
 
5:07 PM
@rchern Hm, I have an older beautified copy..
 
I'm only handling room events for now but this class structure gives me the ability to expand
 
@TimStone, search term that won't have minified stuff?
 
@TimStone DO WANT! :-)
 
@rchern The callback has $("poll-interval").text(Math at the bottom
 
ah yes, good ole function jb!
(;
 
5:09 PM
Which then calls the current-room event handling function which has debugMessage("Unknown event type " in it
It's called ib for me ;)
Looks like the names moved by one :P
So the other function might be called gb (it's fb in what I have)
 
someone needs to hack @balpha's computer for the unminified sources (:
 
Heheh :P
 
<retracted>
 
The function above the second function is where the side-bar updates happen (where that missing MessageDeleted case statement was/is..not ;))
 
I said nothing...
 
5:13 PM
let's just hope he doesn't look at pidgin where the message still lives, right?
 
@rchern DAMNIT!!!! Foiled by my own code!!!
I HATE it when that happens!
Welcome, @JuhaSyrjälä
 
@rchern Hahahahah
 
I keep getting kicked off my own XMPP server... very strange
/blame rchern
 
*ahem*
 
@rchern Too late, it's been 2 minutes already :-)
 
5:29 PM
hrmph
 
5:56 PM
Kicked off my XMPP server again! Anyone who's in the rooms, are you able to stay in the rooms?
 
I'm still there
 
Must be my client. Did you see "josh left the room" / "josh joined the room"?
 
aye
 
Thanks. I think it is my client, not my server
 

« first day (57 days earlier)      last day (681 days later) »