Sunday, April 27, 2014

Another GSoC and a new blog

I've been selected for Google Summer of Code again! I'll be working with the Instantbird team this time as well, to implement indexed chat history and infinite conversation scrollback.

I'll be blogging my progress this time to I've imported this blog there as well for archival purposes. A more detailed post about the project will follow on that site.

Saturday, September 28, 2013

GSoC '13 is over!

Well, Summer of Code 2013 is officially over. My project has pretty much met what was in my proposal - the stats and ranking patch is r+ (though awaiting Florian's approval) and should land soon.

There are a few leftover bugs that I'll be working on when I have time (I've been pretty busy with my coursework lately). Many of them are small (and possibly quick to fix): bugs 2046, 2048, 2069, 2081, 2116, 2076, 2145, 2146, 2184, 2185.

Here's a broad overview of my work over the summer:
  • Modified the tabbrowser to accept generic tabs (bug 426).
  • As an example usage of the new tabbrowser changes, made it possible to open about:* pages in a tab (bug 2002).
  • Wrote the initial new conversation tab, with a list of contacts and a filter box (bug 2015).
  • Added support for existing conversations in the new conversation tab and moved the management of possible conversation data to a new ConversationStatsService (bug 2055).
  • Wrote an API to request protocol plugins for chat room lists, and implemented it for JS-IRC. Made the stats service use this API to display IRC channels in the new conversation tab (bug 2066).
  • Experimented with IndexedDb to store conversation stats. Dropped it in favor of a JSON cache until we migrate to a more sophisticated database from which we can query possible conversations on the fly (and possibly incorporate log indexing?). Wrote code to store these conversation statistics and use them to sort possible conversations. Adapted Florian's log sweeper code to parse JSON logs for stats (bug 2143).

I've learned a lot over the summer. That includes technical stuff - JavaScript, XUL and the Mozilla platform, XPCOM, etc. - as well as a much deeper insight into open source development. I'd contributed to open source before GSoC, but mostly just small patches. This summer I was actively involved in the development process, and got to see how much care and attention is paid to detail when making even small changes. I had to consider things I would've ignored before - localization, accessibility, edge cases, UI profiling, etc. Every UX decision was preceded by lengthy brainstorming and debating sessions on IRC. It wasn't uncommon to spend 10 minutes (sometimes more) figuring out the best name for a variable!

A huge thanks to my mentor Benedikt Pfeifer, and the Instantbird team for all their help over the past three to four months, they've been a pleasure to work with! Be on the lookout for Instantbird 1.5, it's going to be pretty awesome (:P).

You can download a change log of my project from here, or if you have the source, you can generate one yourself using
$hg export `hg log -b default -u nhnt11 | grep changeset | cut -f3 -d ":"`

Friday, September 6, 2013

Progress report: September 6th

This post has been long overdue. Here's the major progress over the last couple weeks:
  • Bug 2066 is merged! Awesometab now queries accounts for chat room lists and displays them (only implemented for IRC, you'll have to flip the chat.irc.allowList preference to true in about:config).
  • Bug 2143 - Ranking and stats are working and have had a couple of review cycles. We decided that efficient and intelligent searching/filtering is a requirement and also that the log sweeping code could be reused for log indexing. Based on all this the IndexedDB has been dropped from this bug in favor of a simple JSON cache for now.
First thing I'll be doing next is optimizing the chat room code from bug 2066 to eliminate UI lag while receiving chat rooms. After that, the priority will be landing bug 2143. Things will likely get slow after that while I have my first test cycle, but once that's over (or possibly before, if 2143 lands quickly) I'll be looking at optimization and better searching (implement a proper database, indexing, etc).


Wednesday, August 21, 2013

Weekly report: August 21st 2013

During the last 7 days, I didn't quite get around to everything I wanted to do (which wasn't helped by 4 of the days being holidays) but there was progress.
  • Bug 2066 (chat rooms and IRC's LIST) is finally r+.
  • I experimented more with frecency scores ("frecency" is inspired by Firefox's Places Frecency algorithm)
  • After a bit of experimenting, I finally decided to stop messing around and get some actual data to play with from logs.
  • Using Florian's WIP from bug 1584, I put together an addon that goes through logs and obtains information on recency (date of most recent log file) and frequency (number of messages exchanged, with separate counters for incoming and outgoing)
  • Playing with the algorithm for a while, I finally ended up with the following:
    • Score = Total message count * frequency multiplier * recency multiplier
    • Here, frequency multiplier is the ratio of outgoing to incoming message counts, and recency multiplier is identical to what Firefox uses.
    • This gave me pretty accurate results, the conversations with the highest scores were definitely what I would most likely want to open if I pressed Command+T :)
Tomorrow I will be working to integrate this into the stats service and use these scores to sort conversations in the newtab.

I again notice that my work over a week seems to be concentrated over one or two days, during which I spend 10-15 hours each day on a kind of frenzy. Meh.

Tuesday, August 13, 2013

3-day report: August 9th, 10th and 12th 2013

  • Played with ranking - using frequency as well as recency as parameters (took most of my time on Friday)
  • Made changes to the way ranks are stored, to better accommodate chats (soon).
  • Updated tabbrowser images for retina displays (bug 2103) (Monday night)

Friday, August 9, 2013

Daily report: August 8th 2013

  • Rewrote the way conversations are stored in IndexedDB. This took most of my time tonight (pesky bugs!).
    • Now, a conversation's rank is stored with the conversation's id as the key.
    • I've defined a conversation's id as the string obtained by concatenating its source and _id values.
    • For contacts this looks something like "contact2", "contact-5", etc. For chats, it's source + accountId + name - for e.g. "chataccount1#instantbird".
  • Added basic ranking. A conversation's rank is the number of times it has been opened. Ranks are updated and stored as conversations are opened.
  • Short term to-do list:
    • Code cleanup
    • Support for chats
    • More sophisticated ranking
    • Obtain historical data from logs

Thursday, August 8, 2013

Weekly report: August 7th 2013

  • More modifications to the chat room list patch (bug 2066) - unfortunately this still isn't ready to land yet.
  • Brainstormed the ranking system and storage of conversation data.
  • Read documentation on IndexedDB and wrote code to store/retrieve contacts in an IndexedDB object store (mostly experimenting with the API and understanding the approach).