koala73/worldmonitor · error · ConvexError

COMPANY_LIMIT_REACHED

Error message

COMPANY_LIMIT_REACHED

What it means

Error "COMPANY_LIMIT_REACHED" thrown in koala73/worldmonitor.

Source

Thrown at convex/companyMonitoring/companies.ts:137

      )
      .unique();
    if (replay) {
      if (replay.directFingerprint !== directFingerprint) {
        throw new ConvexError("REPLAY_CONFLICT");
      }
      return { status: "replayed", companyId: replay.companyId };
    }

    const noop = await findNoopByCustomerReference(
      ctx,
      account.logicalAccountId,
      company.customerReference,
    );
    if (noop) return { status: "noop", companyId: noop.companyId };

    const companyCount = account.companyCount ?? 0;
    if (companyCount >= (account.companyLimit ?? COMPANY_LIMIT)) {
      throw new ConvexError("COMPANY_LIMIT_REACHED");
    }

    const companyId = await insertNormalizedCompany(ctx, account, company, {
      directRequestId: clientRequestId,
      directFingerprint,
    });
    await scheduleCompanySourcesHandler(ctx, {
      ownerAccountId: account.logicalAccountId,
      companyId,
    });
    await ctx.db.patch(account._id, {
      companyCount: companyCount + 1,
      snapshotGeneration: (account.snapshotGeneration ?? 0) + 1,
      updatedAt: Date.now(),
    });
    return { status: "created", companyId };
  },
});

View on GitHub (pinned to ffec79ac33)

When it happens

Trigger: Thrown at convex/companyMonitoring/companies.ts:137 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of koala73/worldmonitor@ffec79ac33 (2026-08-12). Data as JSON: /api/errors/96d90b6330884cb4. Report an issue: GitHub.