Skip to content

Conversation

@PTR-inc
Copy link
Contributor

@PTR-inc PTR-inc commented Feb 22, 2025

This is used in the recode encrypted fields function

Some db functions have the un/escape in the function, but not all. For some it is done in app after the get.

I would propose to move it to the db functions instead of having to not forget it at the application level. I haven't checked all functions, but the GetAll function also doesn't do the unescaping for you.

@si458 What do you think?

This is used in the reencode encrypted fields function
@PTR-inc
Copy link
Contributor Author

PTR-inc commented Feb 22, 2025

The recode function didn't work properly because of the missing unescape in the getalltype function. That triggered this.

@PTR-inc PTR-inc marked this pull request as draft February 23, 2025 08:42
@PTR-inc
Copy link
Contributor Author

PTR-inc commented Feb 23, 2025

@si458 I think a full check on the mongo/nedb un/escape db functions is necessary to do this properly.

@PTR-inc
Copy link
Contributor Author

PTR-inc commented Mar 1, 2025

@si458 Checked some of the functions used throughout the application for the different (un)escapes, here for example is the specific acebase db escapes, beside the nedb escapes. The only escape needed for mongo (v3.6 onward) is that a field must not start with a '$'.
Searching for 'unescape' in the source finds f.e. here and others, which, if forgotten in new functions, could lead to the bug fixed with this PR for the recode function. It would at least be safer to put all the (un)escaping in the db functions, I think.

Is it an idea to eliminate the need for escapes at all by generating the identifiers with something like crypto.randomUUID() or the UUID package?

That would remove a lot of overhead, room for mistakes and make it future-proof and more db agnostic.
What are your thoughts?

@DaanSelen
Copy link
Contributor

@si458 Checked some of the functions used throughout the application for the different (un)escapes, here for example is the specific acebase db escapes, beside the nedb escapes. The only escape needed for mongo (v3.6 onward) is that a field must not start with a '$'. Searching for 'unescape' in the source finds f.e. here and others, which, if forgotten in new functions, could lead to the bug fixed with this PR for the recode function. It would at least be safer to put all the (un)escaping in the db functions, I think.

Is it an idea to eliminate the need for escapes at all by generating the identifiers with something like crypto.randomUUID() or the UUID package?

That would remove a lot of overhead, room for mistakes and make it future-proof and more db agnostic. What are your thoughts?

Have you already spoken about it in the Monthly meetings, seems like a good plan!

@PTR-inc
Copy link
Contributor Author

PTR-inc commented Jun 24, 2025

@DaanSelen Uhm, monthly meetings? Don't know about that.

@DaanSelen
Copy link
Contributor

@DaanSelen Uhm, monthly meetings? Don't know about that.

Every last thursday of the month we meet in a voice/video call and discuss the state of MeshCentral, what's new and what's coming. If you can, join us (I can't make it this thursday). Here for reference: https://github.com/Ylianst/MeshCentral/wiki/Community-Monthly-Meetings

@PTR-inc
Copy link
Contributor Author

PTR-inc commented Jun 24, 2025

Ah oké, thanks, will check it.

@DaanSelen
Copy link
Contributor

Lets get this PR out of limbo and into the master!

@PTR-inc
Copy link
Contributor Author

PTR-inc commented Jun 25, 2025

At least fix this indeed. The enhancement to the id generation/field escapes is of a different order of magnitude to implement. And would need the oké from @si458 and @Ylianst before even starting.

@PTR-inc PTR-inc marked this pull request as ready for review June 25, 2025 09:03
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Aug 25, 2025
@github-actions
Copy link

github-actions bot commented Sep 1, 2025

This pull request has been automatically closed due to inactivity. If you'd like to continue working on it, please reopen it.

@github-actions github-actions bot added the Closed label Sep 1, 2025
@github-actions github-actions bot closed this Sep 1, 2025
@DaanSelen
Copy link
Contributor

This pull request has been automatically closed due to inactivity. If you'd like to continue working on it, please reopen it.

@si458 is this closing in order? Or a mistake?

@si458 si458 reopened this Sep 8, 2025
@github-actions
Copy link

github-actions bot commented Nov 8, 2025

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 8, 2025
@PTR-inc
Copy link
Contributor Author

PTR-inc commented Nov 8, 2025

Not stale

@github-actions github-actions bot removed the Stale label Nov 9, 2025
@DaanSelen
Copy link
Contributor

Not stale

And what's preventing Merge? @si458

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.

3 participants