Friendship acceptance from find friends is fragile

Reported by Richard Mansfield on 2011-09-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Low
Richard Mansfield

Bug Description

On the 2nd and later pages of find friends, accepting a friend request appears to submit without errors, but actually fails to add the user as a friend.

Submitting a friendship acceptance form can also fail in a similar manner when friendship has been accepted or denied in another browser window since the page was loaded.

If the database somehow ends up in a state where both a friend record and a friend request record exist for a pair of users, accepting friend requests fails with an sql error.

Changed in mahara:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Richard Mansfield (richard-mansfield)
milestone: none → 1.5.0

Reviewed: https://reviews.mahara.org/753
Committed: http://gitorious.org/mahara/mahara/commit/6efd41bcdd9f4c73feb5f5c8de4a8feb666f3cfc
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit 6efd41bcdd9f4c73feb5f5c8de4a8feb666f3cfc
Author: Richard Mansfield <email address hidden>
Date: Thu Sep 29 16:09:10 2011 +1300

    Fixes for adding users with friendscontrol set to 'auto' (bug #861985)

    Adding users who automatically accept friends failed when the page
    from which the form was submitted was out of date. This change fixes
    the case where a user adds a friend who has changed their friendscontrol
    setting since the page was loaded. If they have turned friendscontrol
    back to 'auth', the submission will fail with an error; if they have in
    the meantime added a friend request to the user who's submitting the
    form, it will succeed, and if a user with an open friend request somehow
    submits the 'addfriend' form, the friend request will be removed.

    Change-Id: I3ab5c1cf4dd263126abb7d2a34490d18b69b4439
    Signed-off-by: Richard Mansfield <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/752
Committed: http://gitorious.org/mahara/mahara/commit/c03258234b0db155d1eaea474f202c7872cb3eac
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit c03258234b0db155d1eaea474f202c7872cb3eac
Author: Richard Mansfield <email address hidden>
Date: Thu Sep 29 14:50:30 2011 +1300

    Fix acceptance of outdated friendship requests (bug #861985)

    If you submit an accept friendship form from the my friends or find
    friends page, but the request has disappeared in the time since you
    loaded the page, the user receives no feedback. This patch ensures
    that the form is actually submitted and validated, and provides an
    appropriate message if the request has been denied or accepted.

    This patch also ensures that friend acceptance is saved when the
    submitted form appears on the second (or later) page of results.

    Change-Id: I0bdc8fb370670a8ddb1c41c7db2f3e37c9d70d11
    Signed-off-by: Richard Mansfield <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/757
Committed: http://gitorious.org/mahara/mahara/commit/cdfbf8fbc028c7b4586e093d362e1e52de3cef0d
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit cdfbf8fbc028c7b4586e093d362e1e52de3cef0d
Author: Richard Mansfield <email address hidden>
Date: Fri Sep 30 13:52:00 2011 +1300

    Use new add friend form functions on the user/view page (bug #861985)

    Removes some duplication, and also ensures the appropriate forms are
    created on submission to invoke the error message display.

    Change-Id: I792381eec98ef3aaa9fb9558302e5183cd1a375f
    Signed-off-by: Richard Mansfield <email address hidden>

Melissa Draper (melissa) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 status fixreleased
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPjqY0AAoJECXBtiziiXdcrpMIAKO5qOyhN9AQn9fCr32yAEba
wyQwhMOm1wS5eB4Qa29Hbr3c0xgXcwgsIFHfe0SCL92Gt2W3UjB8klrrRYssj5iu
o7DlmKBJhXo7i/AC005KeMTQZfY7ZX/tI8Lqux3FjfhSpRhCPatLLPr/hZHTbB4X
XXI47L8e304a6AwmDgsa9UUejDIjOwmOF7fFTeul8OgS4zSg3GUDQ1tTMW3+7Sns
YNmS3iU2+e0Z1CQlg5BqKwHVzCByuPPXuotvUkBkcLP53k1gUOn3OnMODTfbbrvf
UOVYo510SEKrkMCi0B4rLQHg8Ck2cUc1wS4GhxCOMrAcYDokjgTM98AerGB2sGE=
=uHSn
-----END PGP SIGNATURE-----

Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers