Fix element list updates #21

Open
Vectornaut wants to merge 1 commits from outline-update-fix into main
Collaborator

The incoming branch address issue #20 by making the following changes:

  • In the application state, we store a serial number associated with the current assembly, which is incremented every time we load a new assembly.
  • We include that serial number in the diff key of each element outline item. On the main branch, the diff key is already unique within each assembly, so adding the assembly serial number makes the diff key unique throughout the session (until the serial number wraps around).

If we switch to a system where multiple assemblies can be loaded at the same time, we can use the storage key of the current assembly in place of the serial number of the current assembly.

The incoming branch address issue #20 by making the following changes: - In the application state, we store a serial number associated with the current assembly, which is incremented every time we load a new assembly. - We include that serial number in the diff key of each element outline item. On the main branch, the diff key is already unique within each assembly, so adding the assembly serial number makes the diff key unique throughout the session (until the serial number wraps around). If we switch to a system where multiple assemblies can be loaded at the same time, we can use the storage key of the current assembly in place of the serial number of the current assembly.
Vectornaut added 1 commit 2024-11-16 02:58:42 +00:00
Introduce an assembly serial number, which increments when we load a new
assembly. Include it in each element outline item's diff key.
Owner

If we switch to a system where multiple assemblies can be loaded at the same time, we can use the storage key of the current assembly in place of the serial number of the current assembly.

If you'd prefer, you could just have each Assembly grab a serial number from the state when it is created (updating the serial number in the process). Then you will get a unique key for each entity in each assembly, no matter how dyna3 may be refactored. (You might have an objection that a serial number isn't part of a platonic universe, but even universes need addresses. The serial number won't interact with the contents of the universe in any way, so it's an engineering convenience, not a problem.)

Anyhow let me know if you'd rather change to that scheme, or have me review the code as is. Should be quick on my end either way, there's not too much to this PR.

> If we switch to a system where multiple assemblies can be loaded at the same time, we can use the storage key of the current assembly in place of the serial number of the current assembly. If you'd prefer, you could just have each Assembly grab a serial number from the state when it is created (updating the serial number in the process). Then you will get a unique key for each entity in each assembly, no matter how dyna3 may be refactored. (You might have an objection that a serial number isn't part of a platonic universe, but even universes need addresses. The serial number won't interact with the contents of the universe in any way, so it's an engineering convenience, not a problem.) Anyhow let me know if you'd rather change to that scheme, or have me review the code as is. Should be quick on my end either way, there's not too much to this PR.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin outline-update-fix:outline-update-fix
git checkout outline-update-fix
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: glen/dyna3#21
No description provided.