@pack/hydrogen 2.0.2 → 2.0.4

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.
package/dist/index.js CHANGED
@@ -5299,8 +5299,7 @@ async function fetchTestRulesShared(packClient, withCache, token) {
5299
5299
  async ({
5300
5300
  addDebugData
5301
5301
  }) => {
5302
- const URL2 = process.env.NODE_ENV === "development" ? "http://localhost:8787/tests-updated-at" : "https://test-cache-check-production.packdigital.workers.dev/tests-updated-at";
5303
- debug3("[Pack Test] Fetching timestamp from:", URL2);
5302
+ const URL2 = "https://test-cache-check-production.packdigital.workers.dev/tests-updated-at";
5304
5303
  const resp2 = await fetch(URL2, {
5305
5304
  headers: {
5306
5305
  Authorization: `Bearer ${token}`
@@ -5447,11 +5446,7 @@ async function packClientFetchTestByRules(packClient, testTargetAudienceAttribut
5447
5446
  if (withCache && token) {
5448
5447
  debug3("[Pack Test] Fetching test rules through shared cache");
5449
5448
  try {
5450
- const rules = await fetchTestRulesShared(
5451
- packClient,
5452
- withCache,
5453
- token
5454
- );
5449
+ const rules = await fetchTestRulesShared(packClient, withCache, token);
5455
5450
  localTestResolver.setTestRules(rules);
5456
5451
  debug3(
5457
5452
  "[Pack Test] Updated local resolver with rules from shared cache"
@@ -5459,7 +5454,9 @@ async function packClientFetchTestByRules(packClient, testTargetAudienceAttribut
5459
5454
  const currentTestData = testSession.getTestData();
5460
5455
  let needsNewTest = false;
5461
5456
  if (currentTestData?.id) {
5462
- const freshTestData = localTestResolver.getTestById(currentTestData.id);
5457
+ const freshTestData = localTestResolver.getTestById(
5458
+ currentTestData.id
5459
+ );
5463
5460
  if (!freshTestData) {
5464
5461
  debug3(
5465
5462
  "[Pack Test] Current session test is no longer active (paused/stopped), clearing session:",
@@ -5516,10 +5513,7 @@ async function packClientFetchTestByRules(packClient, testTargetAudienceAttribut
5516
5513
  return void 0;
5517
5514
  }
5518
5515
  } catch (error) {
5519
- debug3(
5520
- "[Pack Test] Failed to fetch test rules:",
5521
- JSON.stringify(error)
5522
- );
5516
+ debug3("[Pack Test] Failed to fetch test rules:", JSON.stringify(error));
5523
5517
  console.error("[Pack Test] Failed to fetch test rules:", error);
5524
5518
  }
5525
5519
  } else {
@@ -5589,9 +5583,7 @@ async function packClientFetchTestByRules(packClient, testTargetAudienceAttribut
5589
5583
  })
5590
5584
  );
5591
5585
  if (!assignedTest) {
5592
- debug3(
5593
- "[Pack Test] No test assigned - user not eligible for any tests"
5594
- );
5586
+ debug3("[Pack Test] No test assigned - user not eligible for any tests");
5595
5587
  return void 0;
5596
5588
  }
5597
5589
  const result = {
@@ -5721,7 +5713,9 @@ async function getTestInfo({
5721
5713
  };
5722
5714
  }
5723
5715
  } else {
5724
- debug3("[Pack Test] Test is no longer active and no new test was assigned");
5716
+ debug3(
5717
+ "[Pack Test] Test is no longer active and no new test was assigned"
5718
+ );
5725
5719
  return void 0;
5726
5720
  }
5727
5721
  } catch (error) {
@@ -5778,9 +5772,7 @@ async function getTestInfo({
5778
5772
  // Not validateOnly - allow assigning new tests
5779
5773
  );
5780
5774
  if (testInfo?.id === exposedTest.id) {
5781
- debug3(
5782
- "[Pack Test] Exposed test was restored (still active)"
5783
- );
5775
+ debug3("[Pack Test] Exposed test was restored (still active)");
5784
5776
  } else if (testInfo) {
5785
5777
  debug3(
5786
5778
  "[Pack Test] Exposed test is no longer active, using newly assigned test:",