Skip to content

v0.29.0

Choose a tag to compare

@zbeyens zbeyens released this 26 Aug 00:55
7129622

@kitcn/resend

Published @kitcn/resend@0.29.0.

kitcn

Minor Changes

  • #421 26dd9b5 Thanks @MikeyZhang75! - ## Breaking changes

    • Register migrationStatus and aggregateBackfillStatus as internal
      queries instead of internal mutations. Polling migration or aggregate
      status no longer opens a write transaction, so a status monitor stops
      competing for OCC write slots on the very tables it is reporting on. Both can
      now back a live subscription, and neither can be scheduled any more.
    // Before — status read had to run from a mutation context
    export const getStatus = authMutation.mutation(async ({ ctx }) => {
      const server = createServerCaller(ctx);
      return await server.migrationStatus({});
    });
    
    // After — status reads from a query context
    export const getStatus = authQuery.query(async ({ ctx }) => {
      const server = createServerCaller(ctx);
      return await server.migrationStatus({});
    });
    • Accept an internalQuery builder in createOrm(...) alongside
      internalMutation. Apps generated by kitcn codegen pass it automatically;
      hand-written createOrm calls that use orm.api() should pass it too so the
      status procedures are built with the app's own Convex builder.
    // Before
    const orm = createOrm({ schema, ormFunctions, internalMutation });
    
    // After
    const orm = createOrm({
      schema,
      ormFunctions,
      internalMutation,
      internalQuery,
    });

    Patches

    • Fix migrationStatus reading the entire migration_run history to return the
      most recent runs. The listing now walks a new by_started_at index in reverse
      and stops at limit, so the cost of a status call no longer grows with the
      number of migrations ever run. Runs that share a startedAt millisecond now
      order newest-first.
    • Bound the limit argument of migrationStatus at MAX_STATUS_RUN_LIMIT
      (100, default 25), exported from kitcn/orm/migrations, so a caller
      cannot reintroduce an unbounded read through the args.
    • Resolve migrationStatus's runId and activeRun through their existing
      indexes instead of scanning the run history. activeRun now agrees with the
      run that migrate cancel targets.