fix(oidb): set envelope reserved=1 on OIDB 0xFE1_2 (user / stranger)

Follow-up to c62f517. Dropping the obsolete field 2 from the body was
necessary but insufficient: newer QQ NT still rejects the request with

    [oidb] one of uid/openid is invaild

The actual trigger is the OIDB envelope-level `reserved` flag.
Lagrange.Core's FetchStrangerByUin sets `Reserved = 1`, our call sent
`Reserved = 0`. The server uses that bit to pick its validation path:

  - reserved=1 → UIN-form variant: server translates body.uin to the
    internal uid itself
  - reserved=0 → UID-form variant: server expects a uid/openid string
    in the body and rejects when it can't find one

Our request body has only `uin` + `keys`, so the UID-form path was
always going to fail. Setting `isUid: true` (which is the existing
flag that flips envelope `reserved` to 1; the parameter name is
historical and misleading) puts the call onto the correct branch.

Applied to both call sites that target OidbSvcTrpcTcp.0xfe1_2:

  - fetchUserProfile (bridge-contacts.ts) — fixes the
    "failed to load self profile for UIN N" warmup warning.
  - getStrangerStatus (actions/extras.ts) — same OIDB cmd; would
    have failed identically if exercised against newer QQ NT.

Also updated the `isUid` JSDoc on OidbCall to spell out the actual
semantic (UIN-form variant marker, not "this call uses UID-keyed
data") since the name will keep tripping people otherwise.
This commit is contained in:
DrSmoothl committed 2026-05-18 14:58:58 +08:00
1 parent ba899782fe
commit 562fd4f7f9
3 files changed
+20 -5

No files matched your search

+10 -4
View File
@@ -20,10 +20,16 @@ export interface OidbCall<TResp = void> {
schema: ProtoSchema;
value: any;
/**
* Sets the OIDB envelope `reserved` field to 1 when true. A handful
* of commands (group/friend list, rkey download) operate on
* UID-keyed data and require this flag — the wire format is
* otherwise identical.
* Sets the OIDB envelope `reserved` field to 1 when true.
*
* The name is historical and misleading: empirically (see Lagrange
* FetchStrangerByUin vs FetchStrangerByUid, fetchGroupList, our own
* highway uploads) the `reserved = 1` flag indicates the UIN-form
* variant of an OIDB call — it tells newer QQ NT to translate the
* UIN in the body to an internal UID rather than running the
* UID-form validator that expects a uid/openid string in the body.
*
* Omit (default false) for genuinely UID-keyed calls.
*/
isUid?: boolean;
};