Skip to content

Payments search returns no items during daily index rebuild #1686

@dd32

Description

@dd32

Describe the bug

The Network Admin payments search sometimes returns no matching records.

To reproduce

  1. Load network admin payments
  2. Search for a payment
  3. See we never* paid it
    (We did, it's just not returning)

Expected behavior

It should list the payment we're looking for...

Why

The payments dashboard is run off a payments_index table which is rebuilt daily through a truncate / re-insert.
If the search activity happens during this rebuild, the search will return no results:

// Truncate existing table.
$wpdb->query( 'TRUNCATE TABLE ' . self::get_table_name() );

What should happen instead, is that the rows should be updated / replaced / removed as needed, rather than just building it fresh daily.

cc @harmonyromo

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions