koala73/worldmonitor · error · ConvexError

COMPANY_MONITORING_ACCOUNT_NOT_FOUND

Error message

COMPANY_MONITORING_ACCOUNT_NOT_FOUND

What it means

Error "COMPANY_MONITORING_ACCOUNT_NOT_FOUND" thrown in koala73/worldmonitor.

Source

Thrown at convex/companyMonitoring/claimPolicyMigration.ts:34

 *
 * The caller threads `nextCursor` through later invocations. New writes already
 * carry the current policy, so companies created while this sequence runs do
 * not need to be captured by the legacy page walk. The account version is
 * written only after Convex reports the final company page complete.
 */
export const migrateAccountClaimPolicy = internalMutation({
  args: {
    ownerAccountId: v.string(),
    cursor: v.optional(v.union(v.string(), v.null())),
  },
  handler: async (ctx, args) => {
    const account = await ctx.db
      .query("companyMonitoringAccounts")
      .withIndex("by_logicalAccountId", (q) =>
        q.eq("logicalAccountId", args.ownerAccountId)
      )
      .unique();
    if (!account) throw new ConvexError("COMPANY_MONITORING_ACCOUNT_NOT_FOUND");
    if (hasCurrentCompanyMonitoringClaimPolicy(account)) {
      return {
        status: "complete" as const,
        companiesProcessed: 0,
        claimsPatched: 0,
        aliasesInserted: 0,
        nextCursor: null,
        claimPolicyVersion: account.claimPolicyVersion,
      };
    }

    const page = await ctx.db
      .query("companyMonitoringCompanies")
      .withIndex("by_account_companyId", (q) =>
        q.eq("ownerAccountId", args.ownerAccountId)
      )
      .paginate({
        cursor: args.cursor ?? null,

View on GitHub (pinned to ffec79ac33)

When it happens

Trigger: Thrown at convex/companyMonitoring/claimPolicyMigration.ts:34 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/b4c20bfee7e2b595. Report an issue: GitHub.