@reventlessdev/reventless-aws 3.0.0-alpha.251 → 3.0.0-alpha.253

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -222,8 +222,21 @@ describe("Util_StoreLayout.bucketNameFor", () => {
222
222
  describe("Util_StoreLayout.keyPrefixFor", () => {
223
223
  // The assertion the whole dual-layout scheme rests on: a ref is
224
224
  // layout-independent, so the same declaration produces the same stored string
225
- // on a per-store stack and a shared one.
226
- testSync("the key prefix is the store name in both layouts", () =>
227
- expect(Util_StoreLayout.keyPrefixFor(~store="productImages"))->toBe("productImages")
225
+ // on a per-store stack and a shared one. Plugin and store are both
226
+ // stack-invariant, so qualifying by plugin keeps that property.
227
+ testSync("the key prefix qualifies the store with its plugin", () =>
228
+ expect(Util_StoreLayout.keyPrefixFor(~plugin="Catalog", ~store="productImages"))->toBe(
229
+ "Catalog/productImages",
230
+ )
231
+ )
232
+
233
+ // The reason it is qualified: the prefix is a platform-global namespace (one
234
+ // distribution, one cache behavior per prefix), so two plugins declaring one
235
+ // store name were unroutable in EITHER layout until the plugin qualified them.
236
+ testSync("two plugins declaring one store name get distinct prefixes", () =>
237
+ expect(
238
+ Util_StoreLayout.keyPrefixFor(~plugin="Catalog", ~store="productImages") !=
239
+ Util_StoreLayout.keyPrefixFor(~plugin="Ordering", ~store="productImages"),
240
+ )->toBe(true)
228
241
  )
229
242
  })
@@ -113,8 +113,11 @@ globalThis.describe("Util_StoreLayout.bucketNameFor", () => {
113
113
  });
114
114
 
115
115
  globalThis.describe("Util_StoreLayout.keyPrefixFor", () => {
116
- globalThis.test("the key prefix is the store name in both layouts", () => {
117
- globalThis.expect(Util_StoreLayout$ReventlessAws.keyPrefixFor("productImages")).toBe("productImages");
116
+ globalThis.test("the key prefix qualifies the store with its plugin", () => {
117
+ globalThis.expect(Util_StoreLayout$ReventlessAws.keyPrefixFor("Catalog", "productImages")).toBe("Catalog/productImages");
118
+ });
119
+ globalThis.test("two plugins declaring one store name get distinct prefixes", () => {
120
+ globalThis.expect(Util_StoreLayout$ReventlessAws.keyPrefixFor("Catalog", "productImages") !== Util_StoreLayout$ReventlessAws.keyPrefixFor("Ordering", "productImages")).toBe(true);
118
121
  });
119
122
  });
120
123