fix(db): detect MongoDB mode + guard getConfigFilePath removed in 1.2.5 - #16
Open
claytontavaresdan wants to merge 1 commit into
Open
claytontavaresdan wants to merge 1 commit into
claytontavaresdan wants to merge 1 commit into
Conversation
…Central 1.2.5) On MeshCentral 1.2.5 running in MongoDB mode, the plugin failed because: 1. The Mongo branch was gated behind meshserver.args.mongodb, which is not populated in the plugin load context (only the core's own db.js gets it). Now falls back to meshserver.parent.args.mongodb. 2. The NeDB fallback called meshserver.getConfigFilePath(...), a method removed in 1.2.5, causing a TypeError. Now guarded with a typeof check and falls back to path.join(dataPath, ...). Fixes ryanblenis#15
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.
Summary / Resumo
EN: Plugin fails on MeshCentral 1.2.5 + MongoDB mode. Root cause: the Mongo branch was gated behind
meshserver.args.mongodb(not populated in plugin load context) and the NeDB fallback calledmeshserver.getConfigFilePath(...)which was removed in 1.2.5.PT: Plugin quebra no MeshCentral 1.2.5 + modo MongoDB. Causa: o branch Mongo era protegido por
meshserver.args.mongodb(não populado no contexto de plugin) e o fallback NeDB chamavameshserver.getConfigFilePath(...)removido no 1.2.5.Fix / Correção
meshserver.args.mongodb || meshserver.parent?.args?.mongodbgetConfigFilePathwithtypeof === 'function', fallback topath.join(dataPath, ...)Fixes #15