Merge lp:~sinzui/launchpad/mailing-list-subscribers-cache-0 into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: 11444
Proposed branch: lp:~sinzui/launchpad/mailing-list-subscribers-cache-0
Merge into: lp:launchpad
Diff against target: 25 lines (+2/-2)
2 files modified
lib/lp/registry/templates/person-participation.pt (+1/-1)
lib/lp/registry/templates/team-mailinglist-subscribers.pt (+1/-1)
To merge this branch: bzr merge lp:~sinzui/launchpad/mailing-list-subscribers-cache-0
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+33681@code.launchpad.net

Description of the change

This is my branch to adjust the cache rules showing mailing list
subscriptions.

    lp:~sinzui/launchpad/mailing-list-subscribers-cache-0
    Diff size: 26
    Launchpad bug:
          https://bugs.launchpad.net/bugs/623083
    Test command: ./bin/test -vv \
          -t test_person_view -t xx-team-membership
          -t mailinglists/subscriptions
    Pre-implementation: no one
    Target release: 10.09

Adjust the cache rules showing mailing list subscriptions
---------------------------------------------------------

<beuno>
I had the following problem:
- Someone signs up for a mailing list
- I look at the current subscribers and that person isn't listed, however,
  they can see that they *are* subscribed
- Disabling the edge redirect and going to production shows the updated data

I waited for at least 10 minutes for this to be updated.

<sinzui>
We just completed our query optimisations for this page so we can consider
changing the cache rules. I propose caching for 10 minutes for anonymous users
only. Logged in users are working so they expect to see changes.

We should also update +participation since its queries were also updated. We
should use anonymous as well because logged in users are currently getting a
private cache, which is not very helpful.

Rules
-----

    * Update +subscribers to cache anonymous only.
    * Update +participation to cache anonymous only.

QA
--

    * Visit your +participation page as an anonymous user.
    * Follow a link to a team that you are subscribed too.
    * View the list of subscribers and find yourself.

    * Visit your +participation page as yourself.
    * Follow a link to a team that you are subscribed too.
    * View the list of subscribers and find yourself.
    * Return to your profile page and choose edit emails.
    * Unsubscribe from the list under test.
    * Visit your +participation page as yourself.
    * Verify you are not listed as subscribed.
    * Visit the team and look at the subscribers page
    * Verify you are not listed.

    * Visit your +participation page as an anonymous user.
    * Verify you are still listed as subscribed
    * Follow a link to a team that you are subscribed too.
    * View the list of subscribers and find yourself.
    * Wait 10 minutes.
    * Visit your +participation page as an anonymous user.
    * Verify you are not listed as subscribed.
    * Follow a link to a team that you are subscribed too.
    * View the list of subscribers verify you are not in the list.

Lint
----

Linting changed files:
  lib/lp/registry/templates/person-participation.pt
  lib/lp/registry/templates/team-mailinglist-subscribers.pt

Test
----

No tests changed. The existing tests verify that cache rules are present,
but they do not concern themselves with the exact condition.

Implementation
--------------

Changed the cache to anonymous, 10 minutes in:

    * lib/lp/registry/templates/person-participation.pt
    * lib/lp/registry/templates/team-mailinglist-subscribers.pt

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/templates/person-participation.pt'
2--- lib/lp/registry/templates/person-participation.pt 2010-08-10 20:15:18 +0000
3+++ lib/lp/registry/templates/person-participation.pt 2010-08-25 18:56:04 +0000
4@@ -32,7 +32,7 @@
5 tal:condition="not: context/teamowner">Mailing List</th>
6 </tr>
7 </thead>
8- <tbody tal:content="cache:private, 30 minute">
9+ <tbody tal:content="cache:anonymous, 10 minute">
10 <tr tal:repeat="participation view/active_participations">
11 <td>
12 <a tal:replace="structure participation/team/fmt:link">name</a>
13
14=== modified file 'lib/lp/registry/templates/team-mailinglist-subscribers.pt'
15--- lib/lp/registry/templates/team-mailinglist-subscribers.pt 2010-06-24 18:49:11 +0000
16+++ lib/lp/registry/templates/team-mailinglist-subscribers.pt 2010-08-25 18:56:04 +0000
17@@ -16,7 +16,7 @@
18 <tal:has-subscribers condition="view/subscribers/currentBatch">
19 <p>The following people are subscribed to the team mailing list and
20 will receive email messages sent to the list.</p>
21- <tal:cache content="cache:public, 60 minute">
22+ <tal:cache content="cache:anonymous, 10 minute">
23 <tal:subscribers replace="structure view/renderTable" />
24 </tal:cache>
25 <br />