Skip to content

fix(frontend): align dm_scope options with backend constants#2034

Open
Huangting-xy wants to merge 1 commit intosipeed:mainfrom
Huangting-xy:fix-dm_scope_alias
Open

fix(frontend): align dm_scope options with backend constants#2034
Huangting-xy wants to merge 1 commit intosipeed:mainfrom
Huangting-xy:fix-dm_scope_alias

Conversation

@Huangting-xy
Copy link

@Huangting-xy Huangting-xy commented Mar 26, 2026

Fixes #1992

Problem

The frontend dm_scope options did not match backend DMScope constants, causing potential issues:

Frontend options:

  • per-channel-peer
  • per-channel ❌ (not recognized by backend)
  • per-peer
  • global ❌ (not recognized by backend)

Backend DMScope constants:

  • main ❌ (missing from frontend)
  • per-peer
  • per-channel-peer
  • per-account-channel-peer ❌ (missing from frontend)

Impact

  • Users selecting per-channel or global in frontend would have their config sent to backend with unrecognized values
  • The backend would fall back to main scope for unrecognized values, causing unexpected behavior
  • The per-account-channel-peer option (supported by backend) was not available in frontend

Solution

  • Replace per-channel with per-account-channel-peer to expose a backend-supported option
  • Replace global with main to match backend DMScope constant

Files Changed

  • web/frontend/src/components/config/form-model.ts

- Replace "per-channel" with "per-account-channel-peer" (backend supports this)
- Replace "global" with "main" to match backend DMScope constant
- This fixes the mismatch between frontend and backend session scope options

Backend DMScope constants:
- main
- per-peer
- per-channel-peer
- per-account-channel-peer

Previously frontend had:
- per-channel (not recognized by backend)
- per-peer ✓
- per-channel-peer ✓
- global (not recognized by backend, should be "main")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sipeed-bot sipeed-bot bot added type: bug Something isn't working domain: config labels Mar 26, 2026
@KristjanKruusRIA
Copy link

Duplicate of #1993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: config type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dm_scope: Frontend/backend value mismatch — "global" and "per-channel" not recognized by backend

2 participants