openvibers/openvibe.sources Commits

The registry keeps an api endpoint's duplicates setting; a seed test checks no endpoint field is dropped (BLS kept every series' 1995 price) (#99)

OP OpenVibers committed 20 days ago · 7d933ba8c4 · 2 files, +12 −0

Changes

ddiff --git a/server/registry.js b/server/registry.js
iindex 5b77df7..44b6b5e 100644
---- a/server/registry.js
++++ b/server/registry.js
@@@ -81,6 +81,7 @@ function validateSource(input, { maxItemsCap = 12000 } = {}) {
if (e.where) out.where = e.where;
// and `extra_lists` (tags, job types) the same way.
if (e.extra_lists) out.extra_lists = e.extra_lists;
++ if (e.duplicates !== undefined) out.duplicates = e.duplicates;
if (e.max_bytes !== undefined) out.max_bytes = e.max_bytes;
if (e.timeout_ms !== undefined) out.timeout_ms = e.timeout_ms;
if (e.request_content_type !== undefined) out.request_content_type = e.request_content_type;
ddiff --git a/test/seeds.test.js b/test/seeds.test.js
iindex 7f9b0ee..68eec29 100644
---- a/test/seeds.test.js
++++ b/test/seeds.test.js
@@@ -30,6 +30,17 @@ t('every seed validates, is disabled, and keys only https endpoints', () => {
}
});
++t('the registry keeps every endpoint field a seed sets (it dropped duplicates: last, 2026-10-24)', () => {
++ // bls-average-prices was created without "duplicates": "last", so every BLS series kept its 1995 price.
++ for (const s of seeds) {
++ const rec = validateSource(s);
++ (s.endpoints || []).forEach((ep, i) => {
++ if (!ep || typeof ep !== 'object') return;
++ for (const k of Object.keys(ep)) assert.deepStrictEqual(rec.endpoints[i][k], ep[k], `${s.key} endpoints[${i}].${k} was dropped or changed by the registry`);
++ });
++ }
++});
++
t('every seed creates through the registry and stays disabled', async () => {
const fresh = await require('./db').testDb();
try {