Sunday, August 16, 2009

WebRequest.AllowAutoRedirect Failure

The most recent release of PockeTwit has an annoying bug that causes the first request upon startup to fail with a communication error.  I finally tracked down the code to one line within our WebRequest factory:

public static HttpWebRequest CreateHttpRequest(Uri uri)
var request = (HttpWebRequest)WebRequest.Create(uri);
request.AllowAutoRedirect = true;
if (!string.IsNullOrEmpty(ClientSettings.ProxyServer))
var proxy = new WebProxy(ClientSettings.ProxyServer, ClientSettings.ProxyPort);
proxy.BypassProxyOnLocal = true;
proxy.Credentials = CredentialCache.DefaultCredentials;
request.Proxy = proxy;
return request;

For some reason, the “request.AllowAutoRedirect = true” is causing the first requests to fail with a “401: Unauthorized” from twitter!  No idea why that would happen, my suspicion is another little “gotcha” from CF.NET 2.0.

Any ideas?

Edit:  It looks like I jumped the gun and did just what everyone else does—blame Twitter’s issue on the client.  I’ve had a lot of reports that other twitter clients are experiencing the same issue.

Monday, August 3, 2009

PockeTwit v.76 Release

It has been a while, but it's finally time for a new PockeTwit update. Some new members have joined the team and have helped bring together a worthwhile release!

First of all, some bugfixes. There was an issue with the "leaked" version of CF.NET 3.7 that many custom ROMs started using. I still have no idea WHY the issue was happening, but I was at least able to circumvent it.

Also, we were installing a Today Screen plugin during the cab install, which requires writing to a portion of the registry that some carriers do not allow. I've taken that out of the install and put it into the application itself (where it can fail gracefully if necessary). So for those people out there with "locked" phones, this version will finally work.

There have also been a number of other miscellaneous crash fixes and performance improvements brought in by a new team member, @johnb2007. He jumped into the code with both feet and found a few ways to speed up rendering and improve battery usage.

@johnb2007 also contributed some new features. You can now follow anyone by entering their twitter id, rather than having to find and select one of their tweets. There is an "advanced" search dialog to help you build complex search queries. And he has added what is probably the most requested feature of all, the ability to delete one's own tweets! Be sure to let him know how much you appreciate his efforts.

@lifanxi has also joined the team to add some important features. You might have noticed he has created his own fork of the PockeTwit code that works with the popular (but currently unavailable) Chinese site, Fanfou. As a part of this effort he translated the entire UI to Chinese. We hope to take the experience he gained performing that work and find an easy way to provide internationalization for many languages within PockeTwit.

@lifanxi has also added support for proxies to the application. So if your network requires the use of one, you'll still be able to use PockeTwit :)

These guys have kept me really busy trying to keep up. We finally had to take a break and decide to release before too much was added at once. But you can expect another release with even more interesting features coming up soon.