Wishlist: "Activity stream" block

Bug #1316324 reported by Nathan Lewis
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Confirmed
Wishlist
Unassigned

Bug Description

This is a bug to keep track of the Activity Stream block that we are implementing.

The activity stream block which can be placed in any page and will display different content depending on the viewer and the type of the page:
 - User dashboard: Show activities that are of interest to the user. Items shown here are affected by the user's Notification settings. Only items that the user has access to will be displayed.
 - User page: Shows activities that the page owner has performed. The contents of this block are filtered by the sharing permissions of the items relative to the viewer. The owner will see all actions they have performed. Any other user will show the actions that the owner performed, but only for items that are shared with them.
 - Group and Institution pages: Show activities that relate to the group or institution. The contents are filtered to only show items that are shared with the viewer. It assumes that the user viewing the stream has access to the group or institution.

This is a complicated patch, so here are some notes to help explain things:

A 'homestream' notification plugin has been implemented. It is basically a placeholder, as the processing of activities happens within the activity stream block.

Activity types have to be updated to be able to be included in the activity stream. We've got plans to implement a large set of new activity types and refactor more of the existing activity types. This first version (we intend to) only include refactors of two existing activity types - "New page access" and "Feedback". Others will be implemented after the initial patch is merged.

The code for selecting items to show in the activity streams is complex and has been broken down into several smaller pieces to allow for testing and easier maintenance. We've implemented a set of php units tests to make sure that the correct activities are showing in the correct streams. This testing is important because it ensures that users will only see activities that they are entitled to see, to maintain privacy.

All of the above is subject to change. Check the following comments.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

With "any page" do you mean
- user dashboard
- user page
- group and institution pages?

What about site pages? What are user pages? Are these profile pages or any portfolio page?

Changed in mahara:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Nathan Lewis (nathan-lewis) wrote :

I originally thought it could go on ANY page(view), but I think I need to exclude site pages (although I just tested it and they don't break it, but site stream isn't in our spec so they will be empty. I don't think it would be very useful because the activities are quite user-centric, but maybe it could be added in the future). User pages = profile + portfolio pages.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3327

Revision history for this message
Nathan Lewis (nathan-lewis) wrote : Re: Add activity stream block

I've submitted the patch, but I'm not sure how ready it is. It's functional and I'm not aware of any bugs. It would be great if some people could have a look at the code and try it out and give any feedback.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hello Nathan,

Can you please provide some testing instructions? For example: What to watch out for, what notifications are displayed when (you say above: "affected by the user's Notification settings" -> so what can be displayed) etc. Since it affects a lot of things, it is necessary to know how to test things. ;-)

Thank you
Kristina

Revision history for this message
Nathan Lewis (nathan-lewis) wrote :

Sure, testing instructions (applicable to current version, but should still be mostly applicable in the future):

In Setting -> Notificaitons, select Home stream for one or more activity types. Currently only New page access and Feedback are enabled.

Add the Activity stream block to your dashboard, profile page and group page. If you did a fresh install then these pages (and the template pages) should already contain these, so you don't have to do it manually (I'm not sure if I included it in the group page template). Before merging to Mahara, we should put the templates back to normal (unless you want to have AS included by default).

Perform some activities. Currently you're limited to changing the access on a page and placing feedback on a page or artefact. To do any useful testing, you'll need to add the AS blocks to other users' pages and perform actions with multiple users.

Look at the AS content. It should reflect the activities you've performed. It does some clever things like group the same activities on the same objects, so it might say 'John and 2 others made 5 comments on Lisa's page "Banana poem"'. Look out for any gramatical errors or links that don't work.

There are a bunch of different criteria that determine what should be in an AS. The paragraph at the start of the fist post gives a basic overview of what should be where. Keep an eye out for anything that is visible to a user who shouldn't be able to see it. You could also try changing Notification settings to see that they correctly affect the contents of only the dashboard AS. Changing sharing permissions on pages and artefacts should change what a user sees when viewing another user's profile or portfolio page AS.

Revision history for this message
Nathan Lewis (nathan-lewis) wrote :

In the last two patch sets, I fixed the problem creating comments (fingers crossed) and caused grouped activities in ASs to be divided by days. For example, if there were three comments yesterday and two today, all on the same object, they will now appear as two items in the AS instead of one. Without this, activities over long time periods would appear to be grouped, e.g. 'X and 7 others made 15 comments on page "Y"', where one comment was made by X today and the other 14 comments were made by six other people last year.

Revision history for this message
Nathan Lewis (nathan-lewis) wrote :

Please note that we intend to add several more features to the activities in the ASs. For example:
- Likes
- Links to actions such as Watch (add a page or artefact to your watchlist)
- The ability to post a comment (feedback) while viewing the stream
- And more.
These additional features will probably be in separate patches to make them easier to test.

Revision history for this message
Steven (stevens-q) wrote :

In the how to test note that was added, you mentioned that "There are a bunch of different criteria that determine what should be in an Activity Stream." How many and what are the different criteria ?

Catalyst QA Tester

Revision history for this message
Nathan Lewis (nathan-lewis) wrote : Re: [Bug 1316324] Re: Add activity stream block
Download full text (4.7 KiB)

Hi Steven.

As I said, the conditions are described at the start of the first post:

 - User dashboard: Show activities that are of interest to the user. Items
shown here are affected by the user's Notification settings. Only items
that the user has access to will be displayed.
 - User page: Shows activities that the page owner has performed. The
contents of this block are filtered by the sharing permissions of the items
relative to the viewer. The owner will see all actions they have performed.
Any other user will show the actions that the owner performed, but only for
items that are shared with them.
 - Group and Institution pages: Show activities that relate to the group or
institution. The contents are filtered to only show items that are shared
with the viewer. It assumes that the user viewing the stream has access to
the group or institution.

All of that is currently limited by what Activity Types have actually been
implemented. As of this patch, there are only two notifications that the
user can set to the activity stream - new page access and new comment. I
chose those two because they were fairly easy for me and testers to
understand, showed how grouping of activities works, showed how activity
stream enabled Activity Types can be implemented or converted and allowed
me to test quite a broad section of the AS core query. Moises has a patch
in now which adds new friend notifications ("Your friend X is now friends
with Y") and I submitted new group member ("User X is now a member of group
Y"). The next one Moises adds will probably be new artefact access
(dependant on Yuliya's artefact access patch, giving "User X changed
sharing on [artefacttype] [artefactname]", for all shareable artefact
types).

You could have a look at blocktype/activitystream/lib.php to see how the
query works. I've added a lot of comments to make it clear what each step
is doing. Or ask if there's anything more that needs clarification.

Nathan

On 29 May 2014 15:07, Steven <email address hidden> wrote:

> In the how to test note that was added, you mentioned that "There are a
> bunch of different criteria that determine what should be in an Activity
> Stream." How many and what are the different criteria ?
>
> Catalyst QA Tester
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1316324
>
> Title:
> Add activity stream block
>
> Status in Mahara ePortfolio:
> Confirmed
>
> Bug description:
> This is a bug to keep track of the Activity Stream block that we are
> implementing.
>
> The activity stream block which can be placed in any page and will
> display different content depending on the viewer and the type of the page:
> - User dashboard: Show activities that are of interest to the user.
> Items shown here are affected by the user's Notification settings. Only
> items that the user has access to will be displayed.
> - User page: Shows activities that the page owner has performed. The
> contents of this block are filtered by the sharing permissions of the items
> relative to the viewer. The owner will see all actions they have performed.
> Any other user will show t...

Read more...

Revision history for this message
Steven (stevens-q) wrote : Re: Add activity stream block

TEST RESULT FOR CONDITIONS

=== Conditions ===
[✔] User dashboard: Show activities that are of interest to the user.
[✔] Items shown here are affected by the user's Notification settings.
[✔] Only items that the user has access to will be displayed.
[✔] User page: Shows activities that the page owner has performed.
[✔] The contents of this block are filtered by the sharing permissions of the items relative to the viewer.
[✔] The owner will see all actions they have performed.
[✔] Any other user will show the actions that the owner performed, but only for items that are shared with them.
[✔] Group and Institution pages: Show activities that relate to the group or institution.
[✔] The contents are filtered to only show items that are shared with the viewer.
[✔] It assumes that the user viewing the stream has access to the group or institution.
[✔] Non Group members are unable to view actions that the owner performed
[✔] currently limited by what Activity Types have actually been implemented.
 [✔] new page access
 [✔] new comment.
[✘] new friend notifications ("Your friend X is now friends with Y") NOT TESTED TODAY
[✘] new group member ("User X is now a member of group Y"). NOT TESTED TODAY

Catalyst QA Approved ✔

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3327
Committed: http://gitorious.org/mahara/mahara/commit/7a7673c052687558e4dd1df0286c938069ed26df
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 7a7673c052687558e4dd1df0286c938069ed26df
Author: Nathan Lewis <email address hidden>
Date: Wed May 7 11:05:11 2014 +1200

Add activity stream block (Bug #1316324)

Change-Id: I49c15aed9e36da0ff4ea4e1fa4d110c112a25215
Signed-off-by: Nathan Lewis <email address hidden>

Revision history for this message
Aaron Wells (u-aaronw) wrote : Re: Add activity stream block

I merged the patch with a list of items to fix in a gerrit comment. The biggest bug I found, was comment visibility was not respected. Private comments, and comments under moderation, showed up in an activity stream.

To replicate:

1. Put an activity stream on User A's profile page
2. User A leaves a comment on User B's page. The comment is marked private by User A, or is awaiting moderation (because User B turned on comment moderation on the page).
3. Log in as User C. When User C navigates to User B's page, they cannot see User A's comments
4. User C navigates to User A's profile page.

Expected result: They should see nothing about the private comments in the activity stream.

Actual result: They see that User A left a comment on the page, and they see the text of the comment.

Aaron Wells (u-aaronw)
tags: added: activitystream
summary: - Add activity stream block
+ Wishlist: "Activity stream" block
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Totara has asked us not to distribute their code for this feature as part of Mahara core. We'd be within our rights under the GPL to redistribute this code anyway. But out of courtesy to them as Mahara project contributors we'll be reverting these commits shortly.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3459

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3459
Committed: http://gitorious.org/mahara/mahara/commit/82c845d95cb719a32b8ac2647babd4d0b2739c9e
Submitter: Yuliya Bozhko (<email address hidden>)
Branch: master

commit 82c845d95cb719a32b8ac2647babd4d0b2739c9e
Author: Nathan Lewis <email address hidden>
Date: Tue Jun 24 13:12:37 2014 +1200

Reverting activity stream patches (Bug #1316324)

Content from the following commits was reverted:

Patch 3327: 7a7673c052687558e4dd1df0286c938069ed26df
"Add activity stream block (Bug #1316324)"

Patch 3374: c538c7451be5076764ec6440a49331768a13414f
"Add likes to activity streams (Bug #1321480)"

Patch 3432: 121e90279fb8f72d81f47c5302726b6a93b7c776
"Add new parameters to the get_activity_body function (Bug #1328729)"

Patch 3434: 2e47dfb1d51368767f27316172c270cb1b8405c4
"Improvements to activity stream body helper (Bug #1328760)"

Change-Id: Id03c156a7c8c016c8dc76c998a73310ea57fe0a5
Signed-off-by: Nathan Lewis <email address hidden>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.