Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move double serverWarnings functionality to common.js #6731

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PTR-inc
Copy link
Contributor

@PTR-inc PTR-inc commented Jan 25, 2025

While doing #6695 I saw that there were two 'addServerWarning' functions defined in meshcentral.js. Probably a residue of the app evolution, but thought this could be cleaned up to common.js so it can be called the same way from everywhere.

@si458
Copy link
Collaborator

si458 commented Jan 26, 2025

this cannot be merged as its all over the place with the code!

you shouldnt including const common = require('./common.js'); in any of the files
they are passed through using parent.common

also addServerWarning is located the same thing on parent or obj.parent so its located in the meshcentral.js
it should not be moved otherwise it can cause issues

@PTR-inc
Copy link
Contributor Author

PTR-inc commented Jan 26, 2025

Ah yes, I thought the const common = require('./common.js'); seemed the cleaner way of accessing common functions to me then the parent.common way. There are different ways common.js is referenced throughout the modules, obj.common = require('./common.js'); being another one.

The serverwarning calls aren't called consistently throughout the modules: addServerWarning/obj.addServerWarning (meshcentral.js), parent.addServerWarning (db.js), obj.parent.addServerWarning (webserver.js) and parent.parent.getServerWarnings (meshuser.js), so it was an effort to clean it up a bit.

@PTR-inc
Copy link
Contributor Author

PTR-inc commented Jan 26, 2025

Oh and there are multiple conflict because of the latest accepted pr's I see.

@PTR-inc PTR-inc marked this pull request as draft January 26, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants