Convex Now Juggles Work and Personal Logins. The Same Upgrade Can Break a Scheduled Job.

Convex 1.50.0 saves several accounts on one machine, but a project ignores them until its own Convex package upgrades, and that upgrade changes how a scheduled job can end.

Convex, the database Jon's site runs on, shipped version 1.50.0 on November 13. The headline feature is one people asked for: the command-line tool can now hold several Convex accounts at once, saved under names like work and personal, and pick the right one for each project folder. No more logging out of one account to work in another.

The hosts are AI characters.

Listen to this story
1:57

There is a catch on each side of the upgrade. The new logins do nothing for a project until that project's own convex package is on 1.50.0. And the same upgrade changes a rule that can make a background job fail where it used to carry on.

Two logins, one folder at a time

Convex's account reference lays out the steps:

  1. In a project folder, run npx convex@latest login --account work --select. That saves the login and ties this folder, and every folder inside it, to work.
  2. In another folder, save the second login the same way: npx convex@latest login --account personal --select. A folder that should reuse a login already saved takes npx convex@latest account select work. The closest folder with a selection wins.
  3. Use npx convex@latest for login, logout and account commands. Plain npx convex can run the older copy installed in the project, and older copies ignore folder selections and use the one shared login.
  4. Upgrade each project's convex package. Only then do npx convex dev and npx convex deploy follow the saved account.

Two things outrank a folder's choice. The CONVEX_ACCOUNT setting overrides it, and a deployment or project key beats every saved account. So a script that carries a deploy key keeps writing where the key points, whatever account the folder has picked. Selections are stored by full path, so a moved project needs selecting again. Logging out with an older copy of the tool wipes the selections and leaves the credentials behind.

The rule that changes under a scheduled job

Convex lets a function schedule work to run later. From 1.50.0, a scheduled mutation that cancels itself (a mutation is a function that writes data) throws an error named ScheduledFunctionCancelingItself. If nothing catches it, the whole write is rolled back and the job is marked failed. Older versions just ignored the cancel and logged a warning. Convex's fix is plain: to end such a job early, return from it.

Before upgrading, search the code for ctx.scheduler.cancel and check whether any job passes in its own ID. The release also makes the tool's credential files on macOS and Linux readable only by their owner, existing ones included.

Jon's agents ran that search on his site. It pins Convex 1.48.0, schedules work in three files, and never calls ctx.scheduler.cancel at all, so for this site the upgrade carries the new logins and none of the breakage. Its publishing scripts write with either the logged-in tool or a deploy key, and the key, by Convex's own rule, still wins.

Sources

Comments

No comments yet.

Sign in to comment. You'll come back to this story.