mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-09 05:10:45 +08:00
Fix key-alarm IM delivery blocked by DSH session sink.
Run session and WhatsApp/IM sinks in parallel so a failing or slow sticky session no longer skips proactive IM delivery (0.1.34). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
3a731389f0
commit
da08c38949
5 changed files with 157 additions and 15 deletions
16
src/index.ts
16
src/index.ts
|
|
@ -35,8 +35,8 @@ import {
|
|||
publishAlarmPushStatus,
|
||||
resetAlarmPushStatus,
|
||||
} from './netx/alarm-push-status.ts'
|
||||
import { deliverAlarmToIm } from './netx/alarm-im.ts'
|
||||
import { deliverAlarmToSession, resetAlarmSession } from './netx/alarm-session.ts'
|
||||
import { dispatchAlarmToSinks } from './netx/alarm-dispatch.ts'
|
||||
import { resetAlarmSession } from './netx/alarm-session.ts'
|
||||
import {
|
||||
capabilityGroupsFromSettings,
|
||||
groupsForPlane,
|
||||
|
|
@ -307,18 +307,18 @@ export function apply(ctx: Context, config: Config = Config({})): void {
|
|||
imBotId: current.imBotId ?? '',
|
||||
imTargetId: current.imTargetId ?? '',
|
||||
})
|
||||
// Prefer target list presence; UI also mirrors this into alarmDeliverIm.
|
||||
const deliverIm = imTargets.length > 0
|
||||
stopAlarmPush = startAlarmPushClient({
|
||||
apiUrl,
|
||||
token,
|
||||
logger: ctx.logger,
|
||||
onAlarm: async (payload) => {
|
||||
if (deliverDsh) {
|
||||
await deliverAlarmToSession(ctx, payload, lang)
|
||||
}
|
||||
await deliverAlarmToIm(ctx, payload, {
|
||||
enabled: deliverIm,
|
||||
targets: imTargets,
|
||||
// Parallel sinks: a stuck/failing DSH sticky session must not block WhatsApp/IM.
|
||||
await dispatchAlarmToSinks(ctx, payload, {
|
||||
deliverDsh,
|
||||
deliverIm,
|
||||
imTargets,
|
||||
lang,
|
||||
})
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue