Mremoteng: Connections not given GUID if Id is empty in connection xml

Created on 24 Aug 2018  路  6Comments  路  Source: mRemoteNG/mRemoteNG

Hi

Expected Behavior

Every UID for object is unique

Current Behavior

It is possible to load to program two objects with identical ID, and leads to Save configuration issue in case SQL server configuration storing.

Possible Solution

Add of uniqueness of every object, and create a new UID for similar and empty UID

Your Environment

  • Version used: Every
  • Operating System and version (e.g. Windows 10 1709 x64):
Bug

All 6 comments

While technically a bug, I don't think this would show up very often during normal use. Each object GUID is a 128bit value, and the chances of any 2 GUIDs being the same is extremely unlikely.

That being said, there are 2 ways we could solve this:

  • The CPU-bound way:
    Detect GUID collisions when modifying the connection list (add connection/folder, load, duplicate). This would require checking through the entire connection list for every operation that changes the collection. As the connection list grows, operation time grows with it by O(n).
  • The memory-bound way:
    Store all connections/folders in a dictionary, with the GUID as a key. We get uniqueness for free at the cost of using more memory (the primary data structure is a simple tree).

If there is a data structure that ensures uniqueness but does not restrict child relationships in a tree structure then we could get the best of both worlds.

We could also just catch exceptions from systems like SQL when we try to pass non-unique keys, or do a quick validation before trying to save. Then, in the cases where a collision is found, generate a new GUID for one of the colliding pairs. This doesn't solve the issue in our own domain, but at least we can guarantee the invariant every GUID must be unique when data passes outside the application.

I am working with a bunch of host, and adding all this hosts by hands is very annoying. I made config.xml with a list of all hosts I need. But didn't set up a GUID. After I loaded this file GUID appeared to be empty.
I think during the import of config file some checks of GUID should be implemented too.

Ahh that makes sense, thanks for the clarification. Yes, that can be done pretty easily

Added a fix and a test for this issue. This will be available in the next minor release

The fix works but only for imports from XML files, importing a CSV with empty ID fields still doesn't work; is it something that will be fixed in the future?

The fix works but only for imports from XML files, importing a CSV with empty ID fields still doesn't work; is it something that will be fixed in the future?

I have this issue as well. Is it possible to apply this fix to the CSV import function?

BR
Claus

Was this page helpful?
0 / 5 - 0 ratings