IRC in Javascript - a contributor’s work

A short time after Instantbird 0.2 was released the js-proto branch was merged into the main development tree. This was the branch where the backend of Instantbird was prepared to support protocol plugins written entirely in Javascript. Not long after that, Patrick Cloke, an active contributor of the project, started working on an implementation of the IRC protocol plugin in Javascript.

Now he has written a long and detailed posting on his blog about the hows and whys, as well as the current status of his work. It’s spiced with lots of references to both Instantbird and specifications of the protocol. So if you’re interested in the technical aspects of Instantbird and how to extend Instantbird with a protocol plugin written in JS then you definitely should go and read it at his blog.

Status update

It’s been three weeks now since the last status update and here’s a short summary of things that have been done in the meantime.

Some contributors are getting more closely involved with the project lately. Subsequently some tasks, such as posting status updates, will occasionally be performed by people besides Florian, in fact this entry was written by Benedikt P.

Done:

  • Making the buddy list ready for the future: the buddy list backend mentioned in the last update has been finished, debugged and finally landed two weeks ago.

  • The Mozilla framework has supported CSS transitions for a while now and we decided to ditch our old animation code in favour of this state-of-the-art technology. Changing the display- and hide-animations on the buddy list is part of bug 504. Along with the change to the buddy list backend it greatly increased the speed when switching on the display of offline buddies. There should no longer be any noticeable delay, even when there are many buddies on the list.

  • If you ever tried to *emphasize* words in a plain text chat, be happy: we are displaying plain text formatting now, such as *bold*, /italics/, underline and |code| (bug 543).

  • We made conversation tabs look more native on Mac, taking advantage of a suggestion from Markus Stange:

    The old flat look:

    Cropped screenshot of the old look of the unified toolbar on Mac

    Now with a nice gradient in the title bar:

    Cropped screenshot of the new look of the unified toolbar on Mac

    If you have any other ideas how to make Instantbird more awesome, feel free to contact us or to file an enhancement request on our bugtracker.

  • Stuff for devs, stuff that matters: we’re using Services.jsm now and were able to reduce the number of lines used to get XPCOM services by 2/3.

  • Brainstorming: some brainstorming about completion of nicknames (among other things) happened on our IRC channel, summarized results and ideas can be found in the wiki.

Status update

It’s time again to give an overview of what we’ve been doing in the last few weeks and what we plan to do next.

Done:

  • The rewrite of the buddy list backend is going well. The new implementation, is almost usable (as long as you don’t need to add, remove or rename a contact). I can’t wait to land this in our nightly builds! (This will occur as soon as everything is re-implemented so there is no feature-loss). Bug 555 tracks this work.
  • I’ve spent some time analyzing the crash reports we have received after the libpurple update. I emailed the Pidgin developers mailing list to share my findings. The feedback received allowed us to fix a whole class of Windows-only crashes by applying a Glib fix.
  • On Mac, the mozilla-central switch from ppc/i386 universal builds to i386/x64 universal builds caused some breakage in our nightly builds.
    • For now, we have reverted to producing ppc/i386 builds, following the direction taken on comm-central.
    • However, we are aware that current nightly builds are pretty broken when run on a PPC machine.
    • We will switch to i386/x64 universal builds as soon as we have a new Mac build machine that can run Mac OS X 10.6 (the current nightly builds are compiled on a PowerMac G5).
  • I wasted a disappointingly large amount of time trying to buy a recent used Mac Mini on ebay, dealing with the confusing messages of an inexperienced seller. Transaction finally canceled today, back to square one :(.
  • Some time spent trying to understand issues with the update system, with our servers, and our buildbot slaves. No exciting details to report about this.
  • Various fixes:
    • Emoticons will no longer annoyingly appear in URLs. This was fixed in bug 207.
    • The issue mentioned previously about message themes installed with the new add-on manager is fixed.
    • The ‘themes’ icon in the preferences dialog has changed (bug 484).

Nightlies fixed and with upgraded libpurple

  • We have nightly builds again on all 3 OSes.
    • We have had issues on the physical machine that hosts our Windows and Linux compilation virtual machines. Even has been hard at work to get them back online as quickly as possible.
    • Additionally, our Windows builds failed with the obscure gklayout.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x2000D93C error message. No, the disk wasn’t full, that would be too easy to understand… After a lot of wasted effort trying to figure out what had changed in the configuration of that machine or in the code, we finally got the solution on IRC from khuey and ted (thanks!): reboot with the /3GB switch to extend the address space.
  • The add-ons manager is usable again on nightlies. We got tired of bug 591801 and pushed for Instantbird a partial backout of the patch from bug 562797. (I haven’t attached it in the bug because this is clearly not a fix, but if other xulrunner application developers want to use it, it’s here. I know Daniel was very happy to have it for BlueGriffon.)
  • Known issue: Message Styles currently don’t work without being unpacked in the profile folder. This means that even though the add-on manager now works, if you install Message Styles with it in your new nightly, they won’t work. Message Styles that were already installed will continue to work even if you upgrade your nightly.
  • We have upgraded libpurple from version 2.6.6 to 2.7.3:
    • No big disaster has been reported, so nightly testers probably don’t need to fear the update.
    • We are tracking the crash reports: we have seen some new reports related to the MSN protocol; we will investigate soon.
    • The Gadu-Gadu protocol support has improved, but is not as fixed as we hoped it would be. We will see if we can find ways to fix it.
    • Our translators may be interested in taking strings from translation files generated based on this new version to help them in the process of upgrading their locale. These new converted files are available here.
  • The patches for minor issues that had been waiting in bugzilla for quite a bit of time (because we didn’t want to land them just before releasing 0.2 or in the middle of the js-proto and mozilla2 branch merges) have landed.
  • We have welcomed translators for two new locales: Chinese and Hebrew! :)
  • We have created an experiments mercurial repository where contributors from our community are enthusiastically experimenting with projects that we look forward to integrating in the default Instantbird code base once they are ready:
    • Mic is working on adapting Firefox Sync to work with Instantbird.
    • clokep is working on a readable implementation of the IRC protocols in JavaScript, leveraging the work that has been done in the last few months on the js-proto branch.
  • I plan to start rewriting the backend of our buddy list next week. The goals of this work are to simplify the code, make it work correctly with protocol plugins implemented in JavaScript, and give us the necessary APIs to implement the contact and tag features we plan add for the 0.3 release.

As always, don’t hesitate to file bugs if you come across them! You are also welcome to join us on IRC (in #instantbird, where we have been more than 20 a few times this week!)

Nightly builds now based on mozilla-central

In late July, I started working on making Instantbird use the Mozilla 2.0 platform (which the recently released Firefox 4 betas are based on). This work, which started in a branch, has recently reached a point where we believe it could benefit from wider testing. The mozilla2 branch was merged Friday, September 10th, 2010.

This didn’t happen as smoothly as I would have hoped, but after 10 (!) bustage fixes, yesterday we were able to provide the first set of Instantbird nightly builds based on Mozilla 2.0. Our slowly growing community on #instantbird has jumped on them, and quickly reported a few significant issues. Thanks to their awesome help, those are fixed, and today we have a new set of nightly builds.

Additional help to test these new builds (Windows and Linux, Mac), will be greatly appreciated.

Known issues of this set of builds:

  • The ‘Show Logs’ menuitems don’t work (already fixed and will work tomorrow).
  • The Add-ons manager is broken. This is bug 591801.
  • The ‘Instantbird’ checkbox in the ‘Update’ pane of the ‘Advanced’ panel of the preference Window is disabled (already fixed and will work tomorrow).

Status update

We’ve been a bit quiet since the 0.2 release, but we haven’t slept all of this time, so let’s do another status update!

After some time spent polishing the new website and dealing with post-release work (like testing and enabling major updates), we have started working toward Instantbird 0.3:

  • Some major refactoring work to allow protocol plugins to be written fully in JavaScript had started a long time before the final 0.2 release. This work was being done in the js-proto branch. The branch has been merged so that our nightly testers can help spot new issues in 0.3a1pre nightly builds. They have been super helpful, and have found 2 regressions, which are now fixed.
  • Instantbird 0.2 is based on the mozilla-1.9.2 platform. Instantbird 0.3 will be based on Mozilla 2.0. The work to switch to using code from mozilla-central is almost completed. This involved updating our build system (which is a copy of the comm-central one), changing the way our XPCOM components are registered, and other adjustments to make Instantbird’s code work with a newer Mozilla. This work has happened in a mozilla2 branch in our repository. The branch isn’t merged yet because there remains a serious regression that we need to fix (JavaScript code included in message styles isn’t executed).
  • We have welcomed new translators, who have enthusiastically started translations of Instantbird into 7 new locales (Czech, Dutch, Estonian, Italian, Slovak, Spanish and Ukrainian)!

Development is slower than usual this month, because some members of the team, including myself, are taking some time away from the Internet.

In the relatively near future, we will finish the work to switch to Mozilla 2.0, and upgrade libpurple to the latest released version (2.7.*).

Stability

We care a lot about the stability of Instantbird. Again, the Mozilla platform has some great tools to help us here.

Crash Reporting

In the unfortunate event of a crash, a window apologizing for the interruption in your work flow will pop up, and suggest you send some anonymous information about this issue to our servers. We can then analyze it and fix it for a later version, to make Instantbird more stable for you.

Instantbird Crash Reporter dialog

This crash reporting system has already helped us a lot to improve the overall stability of Instantbird.

Crash detection and protection

In previous releases, the worst stability problem that occurred was a crash during start up (while automatically connecting accounts). This was very annoying since it was not possible to use the graphical user interface to change the configuration of the accounts likely to be related to the crash.

In Instantbird 0.2, we have addressed this issue by detecting if the last connection attempt finished correctly, that is, without the application being quit unexpectedly.

Start up crashes are very rare and you will most likely never run into one, but if it does occur to you: don’t worry! At the next start up, you will see the account manager pop up with a message explaining the situation and inviting you to either retry connecting or edit the configuration of your accounts:

Account manager with automatic connection disabled and an error message explaining the problem

If the crash occurred after you added an account or changed the configuration of an account, this account will be the only one that won’t connect at the next startup, and the message in the account manager will look like this:

Account manager where an account was disabled because of a crash during the last connection attempt.

Updates

When we identify the cause of common crashes, or when a serious issue is discovered (for example, an IM network no longer works), we try to quickly release a new minor version including a fix for the issue.

Instantbird will periodically check for updates and notify you automatically if a newer version is available. If you accept the update, it will then be downloaded automatically and applied during the next start up.

Dialog prompting the user to accept a security and stability update

If you expect a new version, you can also force Instantbird to check now for an updates, using the “Check for updates” menu item:

Check for updates menu item

Nightly builds

People who want to very closely follow the development of Instantbird can decide to receive the latest development version daily through this update system. We call these versions the “nightly builds.” These builds are produced automatically every day so that new issues can be detected early on, before they creep up into release builds.

About dialog of a Nightly build of Instantbird

Feel free to use them, but watch out! They may not be stable, and if you decide to use them, you are expected to do so to help us test the bleeding edge features, not just be a cool kid who’s got the new toy first. So if there are bugs, please report them (Filing a bug: what a bug report should contain) instead of complaining.