# Cursor Plugin Convex Rule Async Handling

> Always await promises in Convex functions to prevent unexpected behavior

- Skill: `kunanonj/cursor-plugin-convex-rule-async-handling` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kunanonj/cursor-plugin-convex-rule-async-handling`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kunanonj/cursor-plugin-convex-rule-async-handling/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: KunanonJ (https://skillmd.com/u/kunanonj)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kunanonj/cursor-plugin-convex-rule-async-handling

---


# Async Handling in Convex

Always await all promises in Convex functions. Not awaiting promises (e.g., `await ctx.scheduler.runAfter`, `await ctx.db.patch`, `await ctx.db.insert`) may cause unexpected behavior.

## Examples

**Bad:**
```typescript
export const updateUser = mutation({
  handler: async (ctx, args) => {
    ctx.db.patch(args.userId, { name: args.name }); // Missing await
  }
});
```

**Good:**
```typescript
export const updateUser = mutation({
  handler: async (ctx, args) => {
    await ctx.db.patch(args.userId, { name: args.name });
  }
});
```

Enable the `no-floating-promises` ESLint rule to catch these errors.

