trunk/reviewboard/webapi/json.py (Diff revision 1)
This code should exist as a function (say, get_updated_since_last_visit(user)) in the ReviewRequest class in reviews/models.py. That way it's reusable and not limited to webapi. As far as testing, it's best if you could write a unit test or two or three for this in webapi/tests.py and/or reviews/models.py (for webapi and for the class's new function).
Fixing the review_request_updated JSON API
Review Request #802 — Created April 1, 2009 and discarded
|Review Board SVN (deprecated)|
The current review_request_updated API determines if a review request has been updated based on the presence of any new reviews on the request. What it does not take into account is whether or not the review request itself has been updated since last viewed by the user. For example, a diff could be updated on the review request and the API would return false when in fact the review request has been updated. This change attempts to fix the API by comparing the last_updated field on the ReviewRequest instance with the last time the user visited the review.
Tested using a custom Review Board tool that utilizes the JSON API. Is there a standard way to test JSON API changes?