CodeVetter · Repo Unpack · Behavior traces
meteor/meteor
Four concrete flows were followed through implementation: development startup, application creation, collection insertion, and password login. Startup orders proxy binding, compilation, Mongo readiness, and application listening through promises rather than a single synchronous chain. The persistence and authentication traces preserve material local/remote, permission, and optional-2FA branches.
- Startup begins at meteor → tools/index.js → continueSetup → cli/main; binary commands may exit this chain early, while ordinary commands load Babel and the CLI command modules.
- doRunCommand parses targets/server options → constructs ProjectContext → reads metadata → optionally initializes Cordova → calls runAll.run; runAll creates Runner and awaits init before scheduling or awaiting start.
- Runner.start binds the proxy → starts Mongo asynchronously with up to three attempts → starts updater/HMR when enabled → starts AppRunner; _runOnce prepares and bundles the project, waits for the first-run Mongo promise, starts AppProcess, and switches proxy mode on listening.
- Application creation's setup selects a skeleton from explicit flags or interactive prompts → resolves the destination → rejects nesting inside another Meteor app → checks existing contents before deciding what skeleton files to copy.
- Creation copies a local skeleton when available/prototype/release-selected, otherwise attempts Git cloning with local-copy fallback; setupMessages then reads metadata, writes the release, records completed upgraders, prepares packages, and installs npm dependencies including development dependencies.
- A remote insert follows insertAsync → _insertAsync → _callMutatorMethodAsync → connection.applyAsync; simulation mutates the local collection, while the server chooses restricted validation, insecure mutation, or a 403 rejection.
- Restricted insertion runs deny validators first, requires an allow validator to accept, adds a generated ID after validation, and calls underlying insertAsync; MongoConnection then performs insertOne → observer refresh → write.committed, while cursor observers feed subscription updates into client replication.
- Password login follows internalLoginWithPassword → callLoginMethod → server methods.login → _runLoginHandlers → password handler/checkPasswordAsync → optional 2FA → _attemptLogin validation → _loginUser token insertion and setUserId.packages/accounts-password/password_client.js#L10-29packages/accounts-base/accounts_server.js#L712-720packages/accounts-password/password_server.js#L313-356packages/accounts-base/accounts_server.js#L469-493packages/accounts-base/accounts_server.js#L524-554packages/accounts-base/accounts_server.js#L627-675