feat(voice): add opt-in peer-to-peer calls and country rollouts (#3367)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-10 15:45:17 +02:00
1 parent e5a568acca
commit bef5e33eec
215 files changed
+15840 -2693

No files matched your search

+25
View File
@@ -403,6 +403,7 @@ fn deserialize_instance_config_response_with_unknown_keys() {
"enabled": true,
"config_version": 2,
"rollout_basis_points": 2500,
"rollout_country_codes": ["SE"],
"rollout_salt": "domain-migration-v1",
"included_user_ids": ["1500000000000000001"],
"excluded_user_ids": [],
@@ -416,6 +417,19 @@ fn deserialize_instance_config_response_with_unknown_keys() {
"anonymous_rollout_basis_points": 100,
"standalone_forwarding": true
},
"voice_p2p": {
"enabled": true,
"config_version": 4,
"rollout_basis_points": 750,
"rollout_country_codes": ["SE", "NO"],
"rollout_salt": "voice-p2p-v1",
"included_user_ids": ["1500000000000000001"],
"excluded_user_ids": ["1500000000000000002"],
"included_guild_ids": ["1500000000000000005"],
"include_premium_users": true,
"max_participants": 3,
"future_voice_p2p_knob": true
},
"captcha": {
"enabled": true,
"cost": 5000,
@@ -569,10 +583,21 @@ fn deserialize_instance_config_response_with_unknown_keys() {
assert!(resp.domain_migration.enabled);
assert_eq!(resp.domain_migration.config_version, 2);
assert_eq!(resp.domain_migration.rollout_basis_points, 2500);
assert_eq!(resp.domain_migration.rollout_country_codes.len(), 1);
assert_eq!(*resp.domain_migration.rollout_salt, "domain-migration-v1");
assert_eq!(resp.domain_migration.included_user_ids.len(), 1);
assert_eq!(resp.domain_migration.anonymous_rollout_basis_points, 100);
assert!(resp.domain_migration.standalone_forwarding);
assert!(resp.voice_p2p.enabled);
assert_eq!(resp.voice_p2p.config_version, 4);
assert_eq!(resp.voice_p2p.rollout_basis_points, 750);
assert_eq!(resp.voice_p2p.rollout_country_codes.len(), 2);
assert_eq!(*resp.voice_p2p.rollout_salt, "voice-p2p-v1");
assert_eq!(resp.voice_p2p.included_user_ids.len(), 1);
assert_eq!(resp.voice_p2p.excluded_user_ids.len(), 1);
assert_eq!(resp.voice_p2p.included_guild_ids.len(), 1);
assert!(resp.voice_p2p.include_premium_users);
assert_eq!(resp.voice_p2p.max_participants, 3);
assert!(resp.push_relay.relay_consent_accepted);
assert!(resp.captcha.enabled);
assert_eq!(resp.captcha.max_counter, 1000);
+11
View File
@@ -1391,6 +1391,7 @@ async fn mutating_admin_pages_render_usable_csrf_tokens() {
"/instance-config?action=update_gateway_rollout",
"/instance-config?action=update_sso",
"/instance-config?action=update_domain_migration",
"/instance-config?action=update_voice_p2p",
"/instance-config?action=update_experiment_delivery",
][..],
),
@@ -2424,6 +2425,16 @@ fn instance_config() -> Value {
"anonymous_rollout_basis_points": 0,
"standalone_forwarding": false
},
"voice_p2p": {
"enabled": false,
"config_version": 0,
"rollout_basis_points": 0,
"rollout_country_codes": [],
"rollout_salt": "voice-p2p-v1",
"included_user_ids": [],
"excluded_user_ids": [],
"max_participants": 2
},
"experiment_delivery": {
"poll_interval_seconds": 300,
"poll_jitter_percent": 15