Brion Vibber [Wed, 6 Jan 2010 22:42:46 +0000 (14:42 -0800)]
Ticket 2107: remove "not implemented" items from sms/xmpp help; nobody likes being told what they can't do!
Also broke up the localized help message into line-by-line pieces to ease translation maintenance.
Brion Vibber [Wed, 6 Jan 2010 21:23:39 +0000 (13:23 -0800)]
Rearrange Memcached_DataObject::staticGet() to avoid "only variables can be passed by reference" warnings when DB lookup fails and we return false.
(We need to keep it returning a reference because the extlib parent class is stuck in PHP 4-land and uses references everywhere, including this function's return value. Yuck!)
Also changed pkeyGet to drop the reference, since it doesn't have an upstream equivalent.
Brion Vibber [Wed, 6 Jan 2010 19:10:33 +0000 (11:10 -0800)]
Fix for broken profile flag admin UI: delete stray flag entries when users are deleted so broken entries don't litter the lookups.
* added ProfileDeleteRelated event to match UserDeleteRelated, to allow plugins to add extra related tables on profile deletion
* UserFlagPlugin: deleting flags when target profile is deleted
* UserFlagPlugin: deleting flags when flagging user is deleted
* UserFlagPlugin: fix for autoloader -- class names are case-insensitive. We may get lowercase class names coming in at times, such as when creating DB objects programatically from a table name.
Note that any already-existing bogus entries need to be removed from the database:
select * from user_flag_profile where (select id from profile where id=profile_id) is null;
select * from user_flag_profile where (select id from user where id=user_id) is null;
Brion Vibber [Tue, 5 Jan 2010 23:04:08 +0000 (15:04 -0800)]
Ticket 2135: trim overlong repeats with ellipsis rather than failing.
In web interface and retweet/repeat API we show the original untrimmed text, but some back-compat API messages will still show the trimmed 'RT' version.
This matches Twitter's behavior on overlong retweets, though we're outputting the RT version in more API results than they do.
Brion Vibber [Tue, 5 Jan 2010 23:05:53 +0000 (15:05 -0800)]
Cache fixes:
* We now cache negative lookups; clear them in Memcached_DataObject->insert()
* Mark file.url as a unique key in statusnet.ini so its negative lookups are cleared properly (first save of a notice with a new URL was failing due to double-insert)
* Now using serialization for default in-process cache instead of just saving objects; avoids potential corruption if you save an object to cache, change the original object, then fetch the same key from cache again
Brion Vibber [Mon, 4 Jan 2010 22:38:56 +0000 (14:38 -0800)]
Exclude process-specific link & result cache references from serialized Memcached_Data_Object instances.
Should fix seemingly-random bugs due to destructor free()ing local resources by mistake.
Brion Vibber [Mon, 4 Jan 2010 22:24:16 +0000 (14:24 -0800)]
Exclude process-specific link & result cache references from serialized Memcached_Data_Object instances.
Should fix seemingly-random bugs due to destructor free()ing local resources by mistake.
Brion Vibber [Mon, 4 Jan 2010 21:01:17 +0000 (13:01 -0800)]
Ticket 2141: bugs with weighted popularity lists across year boundary.
Consolidated several separate implementations of the same weighting algorithm into common_sql_weight() and fixed some bugs...
For MySQL, now using timestampdiff() instead of subtraction for the comparison, so we get sane results when the year doesn't match, and utc_timestamp() rather than now() so we don't get negative ages for recent items with local server timezone.
Unknown whether the same problems affect PostgreSQL, but note that it lacks the timestampdiff() SQL function.
Evan Prodromou [Mon, 4 Jan 2010 20:00:17 +0000 (10:00 -1000)]
Memcached_DataObject stores empty values in the cache
There's great value in knowing that something doesn't exist. We
now cache this information, and carefully compare the results from
cache as $results !== false instead of !empty($results), since some
empty values (null, 0, empty array, empty string) are stored in the
cache.
Caching staticGet() and pkeyGet() now store DB misses in the cache,
and cachedQuery() checks for empty results from the cache.
Brion Vibber [Mon, 4 Jan 2010 19:55:27 +0000 (11:55 -0800)]
Ticket 2141: bugs with weighted popularity lists across year boundary.
Consolidated several separate implementations of the same weighting algorithm into common_sql_weight() and fixed some bugs...
For MySQL, now using timestampdiff() instead of subtraction for the comparison, so we get sane results when the year doesn't match, and utc_timestamp() rather than now() so we don't get negative ages for recent items with local server timezone.
Unknown whether the same problems affect PostgreSQL, but note that it lacks the timestampdiff() SQL function.
Evan Prodromou [Mon, 4 Jan 2010 18:59:19 +0000 (08:59 -1000)]
Stop caching unfindable keys
There were some problems with the automated cache/uncache system
for data objects that made us cache unfindable keys (with null
attributes and sometimes null names). Fixed those problems and
refactored the encache() and decache() methods so they use a helper
to find the cache keys to use.
Brion Vibber [Mon, 4 Jan 2010 18:41:52 +0000 (10:41 -0800)]
Drop the overly-prominent link to checklibs display; it's unnecessary and just confuses people.
The ability's still there to aid in debugging, but it won't be tempting people to click on it.