deep-foundation / deep-foundation/deepcase-app

deep.update doesnt update value in editor

Open
#188 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

If we update the value of the link with deep.update we have the updated value in the link, but if we open it in the editor we have the old value before the update:
![image](https://github.com/deep-foundation/deepcase/assets/58123600/7aac5345-04db-4ede-a912-739edaa32bb4)
![image](https://github.com/deep-foundation/deepcase/assets/58123600/fcebf93d-3005-4ed5-9a5f-ea07b5080f39)
![image](https://github.com/deep-foundation/deepcase/assets/58123600/32bb6fd1-f491-4f6a-ba59-096de3dcf7b8)
![image](https://github.com/deep-foundation/deepcase/assets/58123600/41890f02-13ea-41b4-9982-cf560a10c830)
![image](https://github.com/deep-foundation/deepcase/assets/58123600/eb42f605-5371-4223-9305-f10e62cd2cc7)

### To Reproduce

Try to update the value for a random link using deep.update, and after the update, open this link in the editor, as you can see the value is old there (this link must be open in the editor)

### Code snippet
Create a link with the value [] or something else and try to do in the console:

```js
const anyTypeLinkId = await deep.id('@deep-foundation/core', "Any");
const typeTypeLinkId = await deep.id('@deep-foundation/core', "Type");
const containTypeLinkId = await deep.id('@deep-foundation/core', "Contain");
const typeStringLinkId = await deep.id('@deep-foundation/core', "Object");
const typeValueLinkId = await deep.id('@deep-foundation/core', "Value");

const { data: [{ id: testTypeLinkId, }] } = await deep.insert({
type_id: typeTypeLinkId,
in: {
data: {
type_id: containTypeLinkId,
from_id: 380,
string: { data: { value: "Test" } }
},
},
out: {
data: {
type_id: typeValueLinkId,
to_id: typeStringLinkId,
in: {
data: {
from_id: 380,
type_id: containTypeLinkId,
string: { data: { value: 'Test' } },
}
}
}
}
});

const { data: [{ id: testLinkId, }] } = await deep.insert({
type_id:testTypeLinkId,
object:{ data: { value: [] }},
in:{
type_id:containTypeLinkId,
from_id:380,
}
})
```

after that open the editor of this link and close, now you can update its value:

```js
await deep.update(
{
link_id: testLinkId
},
{
value: [1,2,3]
},
{
table: 'objects'
}
);
```
now you can open the editor and see the result `[]`, to update it you need to close this link in the editor and reopen it and see `[1,2,3]`

### Expected behavior

I expect that our editor to have the same value that I replaced the current value for this link with, but right now we can only see it after closing this link in the editor and opening it again

### Package Version

_No response_

### Node.js Version

_No response_

### OS

_No response_

### Additional Library Versions

_No response_

### Additional context/Screenshots

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.