Skip to:
Content

BuddyPress.org

Opened 10 months ago

Closed 9 months ago

#9099 closed defect (bug) (fixed)

Heartbeat requests need better parsing

Reported by: needle's profile needle Owned by: imath's profile imath
Milestone: 12.4.0 Priority: normal
Severity: normal Version: 12.0.0
Component: Activity Keywords: has-patch
Cc:

Description

I opened this ticket on Query Monitor because I thought it was the source of PHP Warnings in my logs... however, it appears that it is BuddyPress that causes QM to throw the PHP Warning.

When heartbeat was added to in 13526, BuddyPress resets the query during all heartbeat requests in bp_core_set_ajax_uri_globals(). This results in WP_Query->is_page = true in WP_Query->parse_query() because $qv['pagename'] is whatever the path component of bp_get_referer_path() is set to, e.g. wp-admin/plugins.php.

This introduces an inconsistency shown by QM because is_singular() reports true yet get_queried_object_id() returns no ID. It seems to me that there needs to be more granularity in the checks in bp_core_set_ajax_uri_globals and that looking at bp_ajax_action_is_registered may not be enough to discern a BuddyPress heartbeat request from ones in which BuddyPress has no interest.

Change History (7)

#1 follow-up: @imath
10 months ago

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

Thanks for your report. @Slaffik told me about it. I’ll try to fix it asap.

#2 in reply to: ↑ 1 @needle
10 months ago

Replying to imath:

Thanks for your report. @Slaffik told me about it. I’ll try to fix it asap.

Thanks for looking into it @imath

#3 @imath
10 months ago

  • Milestone changed from 12.3.0 to 12.4.0

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


9 months ago
#4

  • Keywords has-patch added

The Query Monitor plugin is showing some notice errors about the way some specific Ajax requests were handled by the BP Rewrites API. This PR aims to remove these notices making sure the heartbeat action is about a BuddyPress context.

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

#5 @imath
9 months ago

Hi @needle & @Slaffik

Could you confirm the above PR is fixing the issue with Query Monitor? Thanks in advance.

#6 @imath
9 months ago

In 13752:

Only parse heartbeat requests which relates to BuddyPress context

Props Slaffik, needle, espellcaste

See #9099 (trunk)
Closes https://github.com/buddypress/buddypress/pull/247

#7 @imath
9 months ago

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

In 13753:

Only parse heartbeat requests which relates to BuddyPress context

Props Slaffik, needle, espellcaste

Fixes #9099 (branch 12.0)

Note: See TracTickets for help on using tickets.