@napuketto/loader 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/host/self-host.cjs +16 -7
- package/package.json +1 -1
package/dist/host/self-host.cjs
CHANGED
|
@@ -232,13 +232,19 @@ function registerLoginRefreshAction(actions, refreshQr) {
|
|
|
232
232
|
actions.set("login.refreshQr", async () => refreshQr());
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
|
-
* 从宽松 params 构造 Peer(缺省 chatType=1
|
|
235
|
+
* 从宽松 params 构造 Peer(缺省 chatType=1 私聊)。
|
|
236
236
|
* 优先 peerUid(uid 直通);缺省时 peerUin 经 uinToUid 转换。
|
|
237
237
|
*
|
|
238
|
-
* ⚠️
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
238
|
+
* ⚠️ 群聊(chatType=2)peerUid 直接用群号(kernel Peer 定义「群号 / 用户 uid」,
|
|
239
|
+
* OB11 resolve-peer 同构),**不走 uinToUid**——getUidByUins 是「用户 uin → uid」
|
|
240
|
+
* 转换,传群号属非法调用。
|
|
241
|
+
*
|
|
242
|
+
* ⚠️ 归因更正(2026-08-20):2026-08-09 把 `Cannot read properties of undefined
|
|
243
|
+
* (reading 'service')` 归因为「传群号给 getUidByUins」是**误判**。真因是
|
|
244
|
+
* ipc-bootstrap 把类方法 `GroupApi.uinToUid` 摘成裸函数注入丢了 this(读
|
|
245
|
+
* undefined 的 service)。当时群聊改直通恰好绕开了这条路径,于是「群聊修好了」,
|
|
246
|
+
* 而私聊仍然必炸——直到 2026-08-20 才在 ipc-bootstrap 处 bind 根治。
|
|
247
|
+
* 群聊直通的行为本身仍然正确(上面第一条),保留。
|
|
242
248
|
*/
|
|
243
249
|
async function toPeer(params, uinToUid) {
|
|
244
250
|
const chatType = typeof params["chatType"] === "number" ? params["chatType"] : 1;
|
|
@@ -727,7 +733,7 @@ function createIpcActionsForCore(core) {
|
|
|
727
733
|
* 返回停止函数(清理事件转发订阅;stdin 服务端由 bootstrap-core 独立管理)。
|
|
728
734
|
*/
|
|
729
735
|
function attachIpcServices(actions, services) {
|
|
730
|
-
const
|
|
736
|
+
const uinToUid = services.groupApi.uinToUid?.bind(services.groupApi);
|
|
731
737
|
const full = createIpcActions({
|
|
732
738
|
msgApi: services.msgApi,
|
|
733
739
|
groupApi: services.groupApi,
|
|
@@ -737,7 +743,7 @@ function attachIpcServices(actions, services) {
|
|
|
737
743
|
session: services.session,
|
|
738
744
|
engine: services.engine,
|
|
739
745
|
util: services.util,
|
|
740
|
-
...
|
|
746
|
+
...uinToUid !== void 0 ? { uinToUid } : {}
|
|
741
747
|
});
|
|
742
748
|
for (const [name, handler] of full) actions.set(name, handler);
|
|
743
749
|
const stops = [];
|
|
@@ -1762,6 +1768,9 @@ if (ipcMode) {
|
|
|
1762
1768
|
}
|
|
1763
1769
|
log(`[self-host] 启动 @ ${(/* @__PURE__ */ new Date()).toISOString()} pid=${process.pid} node=${process.version} type=${process.type ?? "(标准 node)"}`);
|
|
1764
1770
|
log(`[self-host] stub 目录: ${env.NAPUTO_STUB_DIR ?? "(PATH 前置,未记录)"}`);
|
|
1771
|
+
process.on("unhandledRejection", (reason) => {
|
|
1772
|
+
log(`[self-host] ⚠️ unhandledRejection: ${errMsg(reason)}`);
|
|
1773
|
+
});
|
|
1765
1774
|
const lockDataDir = env.NAPUTO_CFG_DIR;
|
|
1766
1775
|
if (lockDataDir) {
|
|
1767
1776
|
if (!acquireInstanceLock(lockDataDir)) {
|