lp:~robru/friends/testmode

Created by Robert Bruce Park and last modified
Get this branch:
bzr branch lp:~robru/friends/testmode
Only Robert Bruce Park can upload to this branch. If you are Robert Bruce Park please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Robert Bruce Park
Project:
Friends
Status:
Merged

Recent revisions

129. By Robert Bruce Park

Add a mock Dispatcher that can be used in the libfriends testsuite.

It provides the same API as the real Dispatcher (with tests to prove
it), but it doesn't actually do anything, so no live services will be
tickled by it under test.

Invoke with `friends-service --test` from the libfriends testsuite.

128. By Robert Bruce Park

Avoid a race condition during shutdown.

Now, I don't have any evidence for this, but I had a gut feeling that
this shutdown logic might result in a race condition: the check for
whether this is the last thread to exit happens a little bit before
the thread actually exits, so it might theoretically have been
possible for two threads to exit near-simultaneously, each one seeing
that the other is still running, and then neither opting to initiate
the shutdown procedures.

This way, each thread termination is atomic: each thread is guaranteed
to check whether it is the last one, then perform it's shutdown logic,
without any other threads getting in between the check and the
termination.

127. By Robert Bruce Park

Merge in Ken's modifications regarding the DeeModel.

These changes allow the DeeModel to be controlled by an external vala
daemon that is *radically* more memory-efficient than python is, so
all of our inefficient python code doesn't have to be in memory all of
the time.

126. By Robert Bruce Park

Shut down friends-service once all threads have exited.

We are now relying on dbus-invocation to start the service, at which
point it will run the single method requested, and then exit.

125. By Robert Bruce Park

Rip out ConnectionMonitor and Signaler, since they no longer make sense.

ConnectionMonitor existed mostly only to wrap the NetworkManager API,
to isolate us against incompatibilities between NM 0.8 and NM 0.9...
however, it turns out that Ubuntu 10.04 was the last Ubuntu release to
ship with 0.8. Additionally, since all it does is listen for NM events
over DBus, it doesn't actually do much of anything while
friends-service is not running; so this means that Ken's new vala
daemon is going to have to take over that role. It'll have to be smart
enough not to invoke our dbus methods during times that there is no
internet connection present.

As for Signaler, well, that was a very elegant design by Barry Warsaw,
but we were only using it to signal between ConnectionMonitor and the
Dispatcher (eg, to avoid unnecessary dbus round-trips), so there is no
longer any point in keeping that around.

This commit also adds a new dbus method onto our Dispatcher object,
for the purposes of downloading new contacts from all connected
protocols. This will be necessary in order for our new vala overlords
to invoke it over dbus periodically.

124. By Robert Bruce Park

Stop calling Dispatcher.Refresh() on __init__()

This is in preparation for dbus-invocation, which will call Refresh()
periodically.

123. By Robert Bruce Park

Ensure all protocol methods return a value.

Even if the value is not terribly meaningful, like a count of the
number of the rows in the model, the methods just need to return
*something* for the retval catcher to pass into the success callback.

This is going to come in handy when testing the new async API on the
libfriends side, so we'll be able to see that callbacks are being
called with values in them.

122. By Robert Bruce Park

Small fix for UnboundLocalError in the event that yappi is not installed.

121. By Robert Bruce Park

Disallow posting to disabled accounts. (Closes LP: 1103717)

This one was a bit more involved than I had originally anticipated. It
turns out, revision 113 where we drop this '#/protocol' business and
just use the libaccounts account # directly was incomplete. Our
AccountManager class was still constructing this id string, and it was
inconsistent with the way the ids were being handled everywhere else
in the code.

As a result of this, we experienced a regression such that disabled
accounts weren't being removed from memory correctly, and thus calling
SendMessage began sending messages to accounts that were, in theory,
deleted. This is now fixed.

In addition to this, FakeAccount mock class has been updated to
reflect an id string that is more like what actually gets used in
practise, and many, many, many tests have been updated to reflect this
new value.

While troubleshooting this, I also discovered a new issue that was
introduced in revision 102: when we reduced memory usage by storing
only row index ints rather than DeeModelRowIter objects. The problem
was that when you delete a row, all the rows after it get shifted up
one, so the index ints become stale and incorrect, causing Dee to
raise an unhandled exception about the row index being incorrect next
time you try to access a stale int. So I've thrown in a small check to
bump up the cached index ints each time a row is deleted.

120. By Robert Bruce Park

Fill out a massive amount of documentation on the Base class.

It largely explains how to subclass Base and create a new protocol plugin.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:friends
This branch contains Public information 
Everyone can see this information.