Skip to:
Content

BuddyPress.org

Opened 9 months ago

Closed 9 months ago

#9094 closed defect (bug) (fixed)

Every click on Load more "eats" some posts.

Reported by: testovac's profile testovac Owned by: imath's profile imath
Milestone: 12.3.0 Priority: omg pizza
Severity: normal Version: 11.0.0
Component: Activity Keywords: has-patch has-unit-tests
Cc:

Description

Every click on Load more "eats" some posts. All the content I have in the database will never be shown. Access to activities as a single page works.

tested on two different themes (buddyx and twenty twenty one)

I click the load more button for the first time, the posts are loaded but the first one in the order is missing.
I click the load more button a second time, and there are many missing.
Same for other clicks.

Attachments (1)

admin bp.jpeg (33.5 KB) - added by testovac 9 months ago.

Download all attachments as: .zip

Change History (9)

#1 @imath
9 months ago

  • Keywords needs-patch added
  • Milestone set to 12.3.0
  • Version changed from 12.2.0 to 11.0.0

Hi @testovac

Thanks a lot for your report. I confirm the issue. I believe it's a regression introduced by [13344] where we wanted to avoid duplicates when the Activity Auto Refresh option is active.

It's a pretty nasty one, reason why I want to fix it asap in next minor release, even if it's not due to changes added in branch 12.0.

#2 @imath
9 months ago

  • Keywords needs-unit-tests added

@testovac
9 months ago

#4 follow-up: @imath
9 months ago

Sure, it's there anyway even if this option is not active. This is to avoid duplicates if someone posted an update just before you clicked on the load more button. I've found a fix. I'll submit a PR asap.

This ticket was mentioned in PR #229 on buddypress/buddypress by imath.


9 months ago
#5

  • Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed

The offset lower value needs to remain the higher activity ID of the first displayed page.

Include two unit tests about offset_lower filter usage.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/9094

#6 in reply to: ↑ 4 @testovac
9 months ago

  • Priority changed from strategic to omg pizza

Replying to imath: :-) thx

Sure, it's there anyway even if this option is not active. This is to avoid duplicates if someone posted an update just before you clicked on the load more button. I've found a fix. I'll submit a PR asap.

#7 @imath
9 months ago

In 13724:

Activity: make sure streams are paginated the right way

In [13344] we made sure to avoid the last entry(ies) of the stream to be duplicated if some other members published other entry(ies) just before a user clicked on the "Load More" link.

2 mistakes were made while generating the BP_Activity_Activity MySQL query clause as well as the Load More link query variable causing a regression as some activity entries were wrongly skipped from display each time a user was clicking on this link.

  1. The MySQL query clause built in BP_Activity_Activity::get_filter_sql() needs to also include the last inserted Activity ID using the <= operator instead of the < one.
  2. The query variable added to the Load More link needs to remain the last inserted Activity ID at the time the stream is first displayed.

Props testovac
Antiprops imath

See #9094
Closes https://github.com/buddypress/buddypress/pull/229

#8 @imath
9 months ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 13725:

Activity: make sure streams are paginated the right way

In [13344] we made sure to avoid the last entry(ies) of the stream to be duplicated if some other members published other entry(ies) just before a user clicked on the "Load More" link.

2 mistakes were made while generating the BP_Activity_Activity MySQL query clause as well as the Load More link query variable causing a regression as some activity entries were wrongly skipped from display each time a user was clicking on this link.

  1. The MySQL query clause built in BP_Activity_Activity::get_filter_sql() needs to also include the last inserted Activity ID using the <= operator instead of the < one.
  2. The query variable added to the Load More link needs to remain the last inserted Activity ID at the time the stream is first displayed.

Props testovac
Antiprops imath

Fixes #9094 (branch 12.0)

Note: See TracTickets for help on using tickets.