PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.19
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.19
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
← All changes | includes/Sync/Visibility_Observer.php +18 -2 1.10.131.10.19 View file →
@@ -45,11 +45,22 @@
45 45 final class Visibility_Observer {
46 46 /**
47 47 * Bump when the seeded set changes shape and every install must re-announce it.
48 48 *
49 + * History:
50 + * - 1 (1.10.1): first announcement, for records hidden before the observer existed.
51 + * - 2 (1.10.16): re-announcement. Between 1.10.1 and 1.10.14 the catalogue search
52 + * lane served hidden records when a search carried late `include` ids
53 + * (wcpos/woocommerce-pos#1990), so tills that searched during that window hold
54 + * hidden products the seed-1 tombstones predate and the stream never mentions
55 + * again. Re-seeding drops them through the ordinary changes pull on the next
56 + * tick; the client's existence audit would otherwise be the only path, and on a
57 + * host that reports sustained pressure that audit runs at a trickle
58 + * (wcpos/monorepo#2078).
59 + *
49 60 * @var int
50 61 */
51 - public const SEED_VERSION = 1;
62 + public const SEED_VERSION = 2;
52 63
53 64 /**
54 65 * The one-time seed latch.
55 66 *
@@ -129,9 +140,14 @@
129 140 if ( (int) get_option( self::SEED_VERSION_OPTION, 0 ) >= self::SEED_VERSION ) {
130 141 return;
131 142 }
132 143
133 - $this->journal->append_catalogue_tombstones( $this->visibility->hidden_ids( Pos_Visibility::CATALOG ) );
144 + // Latch only once the rows are in: a transient write failure (missing table, dead
145 + // connection) that latched anyway would never be retried, and the copies this seed
146 + // exists to remove would stay on every till (Codex review, #1995).
147 + if ( ! $this->journal->append_catalogue_tombstones( $this->visibility->hidden_ids( Pos_Visibility::CATALOG ) ) ) {
148 + return;
149 + }
134 150
135 151 // Latched even when the hidden set is empty — otherwise every request on a store that hides
136 152 // nothing would resolve the set again forever.
137 153 // Autoloaded: the Init constructor reads this latch on every request.