@bongos/core 1.19.565 → 1.19.567

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.
@@ -1449,11 +1449,33 @@ test('the in-flight line reads open_intent only, and re-asks the manifest when t
1449
1449
  test('the settings reads fire on entry + tab return only — never on the in-flight tick', () => {
1450
1450
  assert.match(SCRIPT, /if \(!keepRepo\) loadVisibility\(inst\);/);
1451
1451
  const load = fnHub('loadVisibility');
1452
- assert.match(load, /\/settings', \{ credentials: 'same-origin' \}/, 'GET /provisioning/instances/:id/settings');
1453
- assert.match(load, /res\.status === 401 \? signInAgain\(\)/, 'a lapsed session is said as sign-in, not as an outage');
1452
+ assert.match(load, /ensureSettings\(\)/, 'the row comes from the shared reader, not a GET of its own');
1453
+ assert.match(load, /ans\.status === 401 \? signInAgain\(\)/, 'a lapsed session is said as sign-in, not as an outage');
1454
1454
  assert.match(load, /var asked = manageId;/, 'a stale answer must never describe a newer project');
1455
1455
  });
1456
1456
 
1457
+ /* One read of the settings row per manage entry (task 1003582). Three cards
1458
+ render three different keys out of the SAME row, and each used to fetch it
1459
+ for itself — three identical round trips per entry, one more with every card
1460
+ added. tests/manage_settings_shared_read.mjs proves the reader's behaviour;
1461
+ this pins that all three cards actually go through it. */
1462
+ test('the three settings cards share ONE read of the row per manage entry', () => {
1463
+ const ensure = fnHub('ensureSettings');
1464
+ assert.match(ensure, /\/settings', \{ credentials: 'same-origin' \}/, 'GET /provisioning/instances/:id/settings — the one reader');
1465
+ assert.match(ensure, /if \(settingsPromise && settingsFor === manageId\) return settingsPromise;/,
1466
+ 'memoised AND keyed on the project — a switch must never be served the last one’s row');
1467
+ for (const fn of ['loadVisibility', 'loadJoinability', 'loadDoor']) {
1468
+ assert.match(fnHub(fn), /ensureSettings\(\)/, `${fn} reads the row through the shared reader`);
1469
+ assert.doesNotMatch(fnHub(fn), /fetch\(/, `${fn} fires no GET of its own`);
1470
+ }
1471
+ assert.match(SCRIPT, /if \(!keepRepo\) forgetSettings\(\);/,
1472
+ 'the memo is dropped on entry + tab return, so neither is ever served a cached row');
1473
+ /* only the READS are shared: each card still writes its own key */
1474
+ for (const fn of ['doVisSave', 'doJoinSave', 'doDoorSave']) {
1475
+ assert.match(fnHub(fn), /method: 'PATCH'/, `${fn} still PATCHes its own key`);
1476
+ }
1477
+ });
1478
+
1457
1479
  /* ── how people join (task 1003044): the joinability toggle — the visibility
1458
1480
  section's shape, key for key: the choice from the platform's row, what the
1459
1481
  project runs from its own manifest (brand.project.joinability), the save's