refactor(names): agent resolution + one error type

Adopt the simplexmq names rework (PR #7045): name resolution is now
owned by the agent (resolveSimplexName picks a names-role server), so
the chat-side iteration is removed - delete ResolveError,
iterateResolvers, resolveOnUserServers, enabledSMPServersForUser and
resolveErrorToChatError.

One error type: resolver/agent failures flow through ChatErrorAgent;
remove the CEvtSimplexName* events, SimplexNameVerifyFailReason,
SimplexNameConflictEntity and CESimplexNameResolverUnavailable.
APIVerifySimplexName returns CRSimplexNameVerified (verified::Bool),
mirroring CRConnectionVerified. connectPlan handles the name target
directly; updateProfile WithConflict aliases collapsed into the plain
functions.

Add the per-operator "names" SMP server role (migration
20260612_smp_role_names, official operator on by default) feeding
ServerRoles.names -> UserServers.nameSrvs.

Bump simplexmq pin to ce69adfd and regenerate sha256map.nix.
This commit is contained in:
shum
2026-06-13 07:40:36 +00:00
parent fa75978a10
commit 69dee10bd7
38 changed files with 371 additions and 838 deletions
+7 -4
View File
@@ -1862,7 +1862,7 @@ ChatCmdError: Command error (only used in WebSockets API).
### APIVerifySimplexName
Verify a contact's or group's claimed SimpleX name by RSLV-resolving the claim and comparing the resolved link to the peer's stored connection link. Synchronously returns `CRCmdOk`; the verification outcome is delivered asynchronously via [CEvtSimplexNameVerified](./EVENTS.md#cevtsimplexnameverified) or [CEvtSimplexNameVerifyFailed](./EVENTS.md#cevtsimplexnameverifyfailed).
Verify a contact's or group's claimed SimpleX name by RSLV-resolving the claim and comparing the resolved link to the peer's stored connection link. Returns `CRSimplexNameVerified` with a boolean `verified` (a match also writes the verification timestamp); resolver / agent failures are reported as `CRChatCmdError`.
*Network usage*: interactive.
@@ -1885,9 +1885,12 @@ Verify a contact's or group's claimed SimpleX name by RSLV-resolving the claim a
**Responses**:
CmdOk: Ok.
- type: "cmdOk"
- user_: [User](./TYPES.md#user)?
SimplexNameVerified: Result of SimpleX name verification (`verified`: whether the RSLV-resolved link matches the peer's stored link).
- type: "simplexNameVerified"
- user: [User](./TYPES.md#user)
- chatRef: [ChatRef](./TYPES.md#chatref)
- simplexName: [SimplexNameInfo](./TYPES.md#simplexnameinfo)
- verified: bool
ChatCmdError: Command error (only used in WebSockets API).
- type: "chatCmdError"
-60
View File
@@ -10,10 +10,6 @@ This file is generated automatically.
- [ContactDeletedByContact](#contactdeletedbycontact)
- [ReceivedContactRequest](#receivedcontactrequest)
- [NewMemberContactReceivedInv](#newmembercontactreceivedinv)
- [SimplexNameConflict](#simplexnameconflict)
- [SimplexNameVerified](#simplexnameverified)
- [SimplexNameVerifyFailed](#simplexnameverifyfailed)
- [SimplexNameUnverified](#simplexnameunverified)
- [ContactSndReady](#contactsndready)
[Message events](#message-events)
@@ -164,62 +160,6 @@ This event only needs to be processed to associate contact with group, the conne
---
### SimplexNameConflict
A peer's profile update claimed a SimpleX name (`#name.simplex` / `@name.simplex`) that was already held locally by another contact or group. The displaced row's `simplex_name` is set to NULL and the claim moves to the newer row; this event surfaces the displacement so the bot can warn the user about a possible impersonation.
**Record type**:
- type: "simplexNameConflict"
- user: [User](./TYPES.md#user)
- simplexName: [SimplexNameInfo](./TYPES.md#simplexnameinfo)
- entity: [SimplexNameConflictEntity](./TYPES.md#simplexnameconflictentity)
- claimedBy: string
- displacedFrom: string
---
### SimplexNameVerified
RSLV verification of a contact's or group's SimpleX name claim succeeded: the resolved link matches the peer's stored connection link and `simplex_name_verified_at` has been written. Emitted asynchronously after [APIVerifySimplexName](./COMMANDS.md#apiverifysimplexname).
**Record type**:
- type: "simplexNameVerified"
- user: [User](./TYPES.md#user)
- chatRef: [ChatRef](./TYPES.md#chatref)
- simplexName: [SimplexNameInfo](./TYPES.md#simplexnameinfo)
- verifiedAt: UTCTime
---
### SimplexNameVerifyFailed
RSLV verification of a SimpleX name claim did not succeed. `reason` indicates the cause: `SNVFLinkMismatch` (resolved link does not match stored link), `SNVFNameNotRegistered` (no on-chain record exists), or `SNVFResolverError` (transport / proxy failure, with the agent error inline). The `simplex_name` claim is **not** cleared. Emitted asynchronously after [APIVerifySimplexName](./COMMANDS.md#apiverifysimplexname).
**Record type**:
- type: "simplexNameVerifyFailed"
- user: [User](./TYPES.md#user)
- chatRef: [ChatRef](./TYPES.md#chatref)
- simplexName: [SimplexNameInfo](./TYPES.md#simplexnameinfo)
- reason: [SimplexNameVerifyFailReason](./TYPES.md#simplexnameverifyfailreason)
---
### SimplexNameUnverified
A peer's incoming profile update (XInfo / XGrpInfo) carries a SimpleX name claim that the user has not yet verified — i.e. `simplex_name_verified_at` is NULL. Bots / UI may surface an unverified indicator next to the contact / group name; the user can clear it by invoking [APIVerifySimplexName](./COMMANDS.md#apiverifysimplexname).
**Record type**:
- type: "simplexNameUnverified"
- user: [User](./TYPES.md#user)
- chatRef: [ChatRef](./TYPES.md#chatref)
- simplexName: [SimplexNameInfo](./TYPES.md#simplexnameinfo)
---
### ContactSndReady
Connecting via 1-time invitation or after accepting contact request.
+29 -32
View File
@@ -134,6 +134,7 @@ This file is generated automatically.
- [MsgReaction](#msgreaction)
- [MsgReceiptStatus](#msgreceiptstatus)
- [MsgSigStatus](#msgsigstatus)
- [NameErrorType](#nameerrortype)
- [NetworkError](#networkerror)
- [NewUser](#newuser)
- [NoteFolder](#notefolder)
@@ -168,11 +169,9 @@ This file is generated automatically.
- [SecurityCode](#securitycode)
- [SimplePreference](#simplepreference)
- [SimplexLinkType](#simplexlinktype)
- [SimplexNameConflictEntity](#simplexnameconflictentity)
- [SimplexNameDomain](#simplexnamedomain)
- [SimplexNameInfo](#simplexnameinfo)
- [SimplexNameType](#simplexnametype)
- [SimplexNameVerifyFailReason](#simplexnameverifyfailreason)
- [SimplexTLD](#simplextld)
- [SndCIStatusProgress](#sndcistatusprogress)
- [SndConnEvent](#sndconnevent)
@@ -310,6 +309,10 @@ FILE:
- type: "FILE"
- fileErr: [FileErrorType](#fileerrortype)
NAME:
- type: "NAME"
- nameErr: [NameErrorType](#nameerrortype)
PROXY:
- type: "PROXY"
- proxyServer: string
@@ -1066,10 +1069,6 @@ SimplexNameUnprepared:
- type: "simplexNameUnprepared"
- simplexName: [SimplexNameInfo](#simplexnameinfo)
SimplexNameResolverUnavailable:
- type: "simplexNameResolverUnavailable"
- simplexName: [SimplexNameInfo](#simplexnameinfo)
UnsupportedConnReq:
- type: "unsupportedConnReq"
@@ -1961,6 +1960,10 @@ EXPIRED:
INTERNAL:
- type: "INTERNAL"
NAME:
- type: "NAME"
- nameErr: [NameErrorType](#nameerrortype)
DUPLICATE_:
- type: "DUPLICATE_"
@@ -2897,6 +2900,26 @@ Unknown:
- "signedNoKey"
---
## NameErrorType
**Discriminated union type**:
NO_RESOLVER:
- type: "NO_RESOLVER"
NO_NAME:
- type: "NO_NAME"
NO_SERVERS:
- type: "NO_SERVERS"
RESOLVER:
- type: "RESOLVER"
- resolverErr: string
---
## NetworkError
@@ -3509,15 +3532,6 @@ A_QUEUE:
- "relay"
---
## SimplexNameConflictEntity
**Enum type**:
- "contact"
- "group"
---
## SimplexNameDomain
@@ -3546,23 +3560,6 @@ A_QUEUE:
- "contact"
---
## SimplexNameVerifyFailReason
**Discriminated union type**:
LinkMismatch:
- type: "linkMismatch"
NameNotRegistered:
- type: "nameNotRegistered"
ResolverError:
- type: "resolverError"
- agentError: [AgentErrorType](#agenterrortype)
---
## SimplexTLD