openvibers/openvibe.network Commits

Network: Play takes part in account export and deletion (subscribed at its first boot) (#190)

OP OpenVibers committed 30 days ago · 740d7aa5c6 · 2 files, +8 −7

OpenVibe.Play is live (play.openvibe.network) and subscribed to network.account.export_requested and network.account.deleted at its first boot (sub_01M4Y6E6CWYHVH0PQ8Q8DSTA76, sub_01M4Y6E6D2Q302SMV5X1DYVZNW). It now holds the account grants, so Network waits for its export part (scores, unlocks) and its deletion confirmation, as Codes' did after its subscription.

- `principals.js`: `play` joins the export.contribute / deletion.confirm holders.
- `account-data.test.js`: the holder list includes play; the scenarios set it aside with the other newer services.

`npm test`: 121/121.

Changes

ddiff --git a/server/identity/principals.js b/server/identity/principals.js
iindex 53529b8e..2b19ad6d 100644
---- a/server/identity/principals.js
++++ b/server/identity/principals.js
@@@ -54,8 +54,8 @@ const DEFAULT_GRANTS = [
// granted to signed-in players once each (origin earned, games:<game>:<achievement>:<subject> as the key).
['games', 'inventory.item.grant', 'openvibe.inventory', []],
// OpenVibe.Play (contracts 0.172.0, Games ADR-0007 decision 10): Games registers Scraplandia and Salvage Rush as Play
-- // titles and posts their scores and unlocks there. Play subscribes to the account events at boot; its account grants
-- // (export.contribute, deletion.confirm) follow once it is subscribed, as Codes' did.
++ // titles and posts their scores and unlocks there. Play subscribes to the account events at boot (its account grants
++ // are with the other services' above).
...['play.title.manage', 'play.result.write', 'play.player.read'].map((cap) => ['games', cap, 'openvibe.play', []]),
['play', 'events.subscription.manage', 'openvibe.events', []],
['live', 'network.coins.debit', SELF_AUDIENCE, ['live']],
@@@ -116,9 +116,10 @@ const DEFAULT_GRANTS = [
// confirm a deletion; the holders of each grant are the services Network waits for.
// Since 2026-10-08 the services built from the skeleton answer too, through openvibe-sdk/account-data (SDK 0.36.0),
// and since 2026-10-09 the older services that hold personal rows (SDK 0.37.0; each subscribed before this grant).
-- // Codes since 2026-10-14 (its run_tasks, plan T16; subscribed first through Network#178).
++ // Codes since 2026-10-14 (its run_tasks, plan T16; subscribed first through Network#178). Play since 2026-10-14 (its
++ // scores and unlocks; subscribed at its first boot, Network#189).
...['live', 'chat', 'community', 'media', 'games', 'actor', 'food', 'help', 'work', 'quest', 'rent', 'media-hub',
-- 'deals', 'trade', 'tips', 'vip', 'watch', 'services', 'wiki', 'blog', 'bot', 'inventory', 'codes'].flatMap((svc) => [
++ 'deals', 'trade', 'tips', 'vip', 'watch', 'services', 'wiki', 'blog', 'bot', 'inventory', 'codes', 'play'].flatMap((svc) => [
[svc, 'network.account.export.contribute', SELF_AUDIENCE, []],
[svc, 'network.account.deletion.confirm', SELF_AUDIENCE, []],
]),
ddiff --git a/test/account-data.test.js b/test/account-data.test.js
iindex 921bd2ed..861ea7ba 100644
---- a/test/account-data.test.js
++++ b/test/account-data.test.js
@@@ -93,11 +93,11 @@ const server = http.createServer(app);
// ── Export ──
const seeded = await accountData.expectedServices(db, 'network.account.export.contribute');
-- assert.deepStrictEqual(seeded, ['actor', 'blog', 'bot', 'chat', 'codes', 'community', 'deals', 'food', 'games', 'help', 'inventory', 'live', 'media', 'media-hub', 'quest', 'rent', 'services', 'tips', 'trade', 'vip', 'watch', 'wiki', 'work'],
-- 'the holders of the contribute grant: the skeleton services answer too since 2026-10-08 and the older ones since 2026-10-09 (openvibe-sdk/account-data); Space left with the forum; Codes since 2026-10-14 (its run tasks)');
++ assert.deepStrictEqual(seeded, ['actor', 'blog', 'bot', 'chat', 'codes', 'community', 'deals', 'food', 'games', 'help', 'inventory', 'live', 'media', 'media-hub', 'play', 'quest', 'rent', 'services', 'tips', 'trade', 'vip', 'watch', 'wiki', 'work'],
++ 'the holders of the contribute grant: the skeleton services answer too since 2026-10-08 and the older ones since 2026-10-09 (openvibe-sdk/account-data); Space left with the forum; Codes and Play since 2026-10-14 (run tasks; scores and unlocks)');
// The scenarios below follow five services; the newer ones are set aside here, exactly as an operator would
// revoke a service's grant (the same rows, the same revoked_at).
-- for (const svc of ['actor', 'blog', 'bot', 'codes', 'deals', 'food', 'help', 'inventory', 'media-hub', 'quest', 'rent', 'services', 'tips', 'trade', 'vip', 'watch', 'wiki', 'work']) {
++ for (const svc of ['actor', 'blog', 'bot', 'codes', 'deals', 'food', 'help', 'inventory', 'media-hub', 'play', 'quest', 'rent', 'services', 'tips', 'trade', 'vip', 'watch', 'wiki', 'work']) {
for (const cap of ['network.account.export.contribute', 'network.account.deletion.confirm']) {
await db.prepare('UPDATE principal_grants SET revoked_at = ov_now() WHERE client_id = ? AND capability = ? AND revoked_at IS NULL').run(svc, cap);
}