Repository navigation
fix: Stop start-up quietly on a reload and run the dev bot on shared's source - #230
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Three problems with
npm run dev:allon macOS:tsx watchrestarts with SIGTERM, andshutdown()closed the database whilemain()was still starting. The log then showed "Connected to MongoDB", followed by the log history failing withMongoNotConnectedErrorand "Lost the connection to MongoDB". There are three parts to the fix:isShuttingDown()insrc/core/shutdown.ts.BootReport.stopWhen, which prints nothing once shutdown has begun and ends start-up withStartupStopped.closingflag insrc/database/connection.ts, so a disconnect thatdisconnectDatabaseasked for is not reported as a lost connection.@testify/sharedfrom its source.shared/package.jsongains anexportsmap whosedevelopmentcondition points atsrc/index.ts.npm run devanddev:all'sBOT_WATCHpass--conditions=development.shared/dist, built just before the watcher started. A branch switched under a runningdev:allleft it on a build without a new export:Cannot read properties of undefined (reading 'describe')atsrc/config/instance.ts. On macOS, the watcher also saw that build's write and restarted the bot a second after it started.requireexport,shared/dist/index.js.ECANCELED, and the syncing restarts the watcher over and over.dev:allrecognises that line (syncedFolderRead) and says once to move the project or end its folder name with.nosync. The README's troubleshooting table says the same fornpm run dev.AGENTS §15 and §24 and the dashboard guide describe the new behaviour. The consumers table in AGENTS §24 now lists the dev bot. Its warning names what still reads
shared/dist: the built bot,npm run setupand the docs generators.Why
The logs said the database had both connected and been lost in the same start. The stale build crashed the dev bot after a branch switch, naming nothing that pointed at the cause.
How to verify
npm run checkpasses.rm -rf dist && npm run buildsucceeds, and no alias is left unrewritten indist. The loader smoke test registers 96 commands, 53 buttons, 4 menus and 107 aliases.node -p 'require.resolve("@testify/shared")'givesshared/dist/index.js. With--conditions=developmentit givesshared/src/index.ts.startup.test.ts: says nothing once shutting down.connection.test.ts: a disconnect it asked for is not a lost connection.devAll.test.ts: thedevelopmentcondition is in both scripts, and theexportsentry points at source.Checklist
develop, and this pull request targetsdevelopnpm run checkpassessave()on numeric fields (no data code touched)embed()factory (none touched)console.*src/config/env.tsandscripts/setupEnv.ts(none added)npm run docs:commandsre-run if a command changed (no command changed)Generated by Claude Code