Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

#5907 closed defect (bug) (fixed)

"Load Newest" issue

Reported by: namrons's profile namrons Owned by: boonebgorges's profile boonebgorges
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.0.3
Component: Activity Keywords: has-patch
Cc:

Description

When new content is detected a “Load Newest” button appears but if the user who posted the update deletes the update a few seconds afterwards, the update still loads to other users activity streams even though it was deleted previously, and they are still able to comment on it without an error being reported. In this instance would it not be appropriate to have an error appear such as “Sorry, that update was deleted by the poster” or something to that affect?

https://buddypress.org/support/topic/heartbeat-api-and-the-load-newest-function/

Attachments (3)

5907.unittest.patch (750 bytes) - added by imath 9 years ago.
5907.patch (1.1 KB) - added by imath 9 years ago.
5907.message.patch (4.3 KB) - added by imath 9 years ago.

Download all attachments as: .zip

Change History (12)

#1 @imath
9 years ago

  • Component changed from Core to Activity
  • Milestone changed from Awaiting Review to 2.2

Hi namrons,

Thanks for your feedback, this is not related to the heartbeat feature i think, as if you create an update in one browser and display it in another one, delete it from the first browser and comment it from the second one, you have the same issue.

Working on it.

@imath
9 years ago

@imath
9 years ago

#2 @imath
9 years ago

  • Keywords has-patch added

Added 5907.unittest.patch to test the issue and 5907.patch to solve it.

Before recording a comment we are actually getting the parent activity. But we only check for its visibility, defaulting to null if empty. So i think we just need to bail if the parent activity has an empty date_recorded field.

#3 follow-up: @boonebgorges
9 years ago

  • Keywords commit added

This looks like a good minimal fix. Let's get it committed.

It might be worth another ticket, but perhaps we could also look at improvements for the AJAX here, which would give a more specific error message in the case that the parent message has been deleted.

#4 in reply to: ↑ 3 @imath
9 years ago

Replying to boonebgorges:

It might be worth another ticket, but perhaps we could also look at improvements for the AJAX here, which would give a more specific error message in the case that the parent message has been deleted.

I agree, i will leave the ticket opened after commit is done and will try to suggest a patch to handle this case in the ajax function.

Last edited 9 years ago by imath (previous) (diff)

#5 @imath
9 years ago

In 9052:

Make sure the parent activity exists before adding a comment to it.

There can be a case when the activity displayed in the stream has been deleted by another user. Adding a comment should not be possible for this particular case as the parent activity does not exist anymore. The patch is adding a check on the date_recorded field of the parent activity before adding a comment. If it is not set, then false is returned and a default message is displayed to the user by bp_legacy_theme_new_activity_comment(). As boonebgorges, some improvements on the message can still be added.

See #5907

#6 @imath
9 years ago

I'm not sure i'm the best at this (write good english), but here's my suggestion: 5907.message.patch ;)

#7 @imath
9 years ago

  • Keywords commit removed

@imath
9 years ago

#8 @boonebgorges
9 years ago

  • Owner set to boonebgorges
  • Status changed from new to assigned

Thanks, imath. I'm going to make some minor text changes and commit.

#9 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 9054:

Better error message when attempting to reply to an activity item that has been deleted

Fixes #5907

Props imath

Note: See TracTickets for help on using tickets.