Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/10/2026 12:35:43 AM (2 weeks ago)
Author:
johnjamesjacoby
Message:

Counts: synchronize metadata across concurrent writes.

Introduce bbp_bump_count_meta() to update existing numeric metadata with bounded compare-and-swap retries while preserving WordPress metadata filters, actions, sanitization, and cache invalidation. Apply atomic differences to forum, topic, reply, ancestor, and user contribution counts.

Reconcile counts, engagements, and voices across status transitions, permanent deletion, author changes and reassignment, moderator move/merge/split operations, and repair recounts. Correct recursive forum totals and reply visibility, and preserve term-backed favorites and subscriptions during engagement rebuilds.

Document the count-hook compatibility changes and new helper arguments, and add regression coverage for single-site and multisite workflows.

In trunk, for 2.7.

Props alex-ye.
Fixes #2233.
Fixes #3678.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/engagements.php

    r7380 r7467  
    430430         *
    431431         * @since 2.6.0 bbPress (r6737)
     432         * @since 2.6.16 Limit removal to the requested relationship taxonomy.
    432433         *
    433434         * @param int    $object_id The object id.
    … …  
    439440         */
    440441        public function remove_object_from_all_users( $object_id = 0, $meta_key = '', $meta_type = 'post' ) {
    441                 return wp_delete_object_term_relationships( $object_id, get_object_taxonomies( 'bbp_user' ) );
     442                $tax_key = "{$meta_key}_{$meta_type}";
     443                $this->jit_taxonomy( $tax_key );
     444
     445                return wp_delete_object_term_relationships( $object_id, $tax_key );
    442446        }
    443447
Note: See TracChangeset for help on using the changeset viewer.