fix(lint): flatten max-depth in storeTcTokensFromHistorySync
CI lint failed with: process-message.ts:127:6 error Blocks are nested too deeply (5). Maximum allowed is 4 max-depth The previous shape nested `if (pnsToResolve.length) → try → if (mappings) → for → if (pn && lid)` = 5 levels. Flattened to 4 by: - Using `mappings ?? []` so the for-of can iterate without an outer guard - Inverting the inner predicate to `if (!pn || !lid) continue` No behavior change. CI should now pass.
This commit is contained in:
@@ -122,10 +122,10 @@ async function storeTcTokensFromHistorySync(
|
||||
if (pnsToResolve.length) {
|
||||
try {
|
||||
const mappings = await signalRepository.lidMapping.getLIDsForPNs(pnsToResolve)
|
||||
if (mappings) {
|
||||
for (const { pn, lid } of mappings) {
|
||||
if (pn && lid) pnToLid.set(jidNormalizedUser(pn), lid)
|
||||
}
|
||||
// Flat loop (continue-on-skip) keeps max nesting depth at 4 for lint.
|
||||
for (const { pn, lid } of mappings ?? []) {
|
||||
if (!pn || !lid) continue
|
||||
pnToLid.set(jidNormalizedUser(pn), lid)
|
||||
}
|
||||
} catch (err) {
|
||||
// Per-chat fallback below (storageJid := jid). Don't abort the chunk —
|
||||
|
||||
Reference in New Issue
Block a user