lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Possible ID collision when saving a project

Open jasp00 opened this issue 7 years ago • 5 comments

https://github.com/LMMS/lmms/pull/2875#issuecomment-448790522:

there might still be the potential here for ID collisions. Say a control with ID EO_ID_MSB | 0xf00 is automated, then it will be saved with ID 0xf00. Now, when the project is reloaded, it is possible for another control to be given ID EO_ID_MSB | 0xf00, which is now free, and if that were automated, an ID collision would occur when saving the file. The chances of this depend on the number of controls already automated, but EO_ID_MSB is 2^23 so they will tend to lie around 1 in a million.

@DomClark, do you want to handle this?

jasp00 avatar Dec 20 '18 01:12 jasp00

I think I might be going to fix this later.

PhysSong avatar Dec 20 '18 02:12 PhysSong

Fixing this should make #4723 unnecessary, since you will not need to look for alternate ids.

jasp00 avatar Dec 20 '18 22:12 jasp00

True. That's why I said that's a temporary patch.

PhysSong avatar Dec 20 '18 23:12 PhysSong

Reviving this issue because it's been stale for a hot minute and I'm considering working on it. Would it be worth using Qt-provided UUIDs for this? Automation UUIDs would be saved in and restored from the project file and newly created IDs for... well, anything, really - would have only an infinitesimal probability of collision, since they'd span a 128-bit range. Would blow up project file size a bit since you'd now need to add 16 bytes per saved UUID, but would fix collision issues once and for all.

irrenhaus3 avatar Jul 10 '21 03:07 irrenhaus3

...I'm considering working on it.

You got a thumbs up from @DomClark so I'm assigning this to you.

zonkmachine avatar Aug 26 '21 13:08 zonkmachine