mirror of
https://github.com/appy-one/acebase-core.git
synced 2026-05-24 22:01:23 -06:00
[GH-ISSUE #10] Copying objects within DataProxy #12
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/acebase-core#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @appy-one on GitHub (Jun 11, 2021).
Original GitHub issue: https://github.com/appy-one/acebase-core/issues/10
Originally assigned to: @appy-one on GitHub.
When assigning a proxied object to another location within the DataProxy, making changes to it will also change the original in memory. It updates the db at the right location though, so there is a discrepancy between in-memory and db states.
Example:
Note that this is normal javascript object behavior but should be prevented in this proxied database context.
The solution would be to clone the object at assignment.
@appy-one commented on GitHub (Jun 11, 2021):
When cloning assigned objects, this will also fix unexpected situations where the database is not updated, but the in-memory value is:
When cloning the value, this will become the behavior:
@appy-one commented on GitHub (Jul 14, 2021):
Fix published in
acebase-corev1.5.0