When a user creates a new element (variable, function symbol, observation), its new "default" ID is currently generated on the frontend side and then sent to the backend. This might cause issues occasionally; for example, duplicate IDs can arise in some special cases. Instead, we should fully generate the IDs on the backend to avoid any such issues.
The Rust side already supports ID generation (each manager class can safely generate unique IDs for all kinds of objects it manages). We just need to start using it in events. That will require:
implement new add_default_XY events for each kind of element (vars, ...) that will internally generate the ID
state-change variant will be the classical add event, reverse will be the classical remove event
design how the default IDs should look and perhaps change the ID-generating function
hook the new events at the frontend
An experimental version of this has already been implemented for property IDs. We can use a modified version of it as a baseline.
These new add_default events should also internally assign other default values, like variable names (same as IDs) or function arity (default zero).
When a user creates a new element (variable, function symbol, observation), its new "default" ID is currently generated on the frontend side and then sent to the backend. This might cause issues occasionally; for example, duplicate IDs can arise in some special cases. Instead, we should fully generate the IDs on the backend to avoid any such issues.
The Rust side already supports ID generation (each manager class can safely generate unique IDs for all kinds of objects it manages). We just need to start using it in events. That will require:
add_default_XY
events for each kind of element (vars, ...) that will internally generate the IDstate-change
variant will be the classicaladd
event,reverse
will be the classicalremove
eventAn experimental version of this has already been implemented for property IDs. We can use a modified version of it as a baseline.
These new
add_default
events should also internally assign other default values, like variable names (same as IDs) or function arity (default zero).