New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item take revision of other item on updateMany #17091
Comments
Linear: ENG-460 |
This reminds me of #12460, but not sure are they related since that was a few versions ago. With that said, would you mind checking whether it is still unresolved on the latest version? which should be Can you try reproducing this on a fresh Directus instance with fresh db as well? Are you using autoincrement integer as primary key or something else? I'm curious why the ID shows up, but perhaps you are just setting it to not be hidden and not actually editing the IDs? |
IDs from other table, I don't have autoincrement, but his unique. And to develop in (All screens come from the same item) |
Hi @azrikahar, I'm working with @rmarquet21 and to elaborate a little bit:
Yes, it is extremely similar, and it might be the same bug actually: updating items one by one using
We do not use autoincrement IDs as primary key. We are using pre-defined IDs from another knowledge base.
Yes. I just updated our docker container to the latest version
(Yes, we forgot to set the ID to Readonly, this is a mistake... but I assure you that the IDs are never pushed during updates.)
import { Directus } from '@directus/sdk';
const client = new Directus(/* ... */);
await client.items('sample').createMany([
{
id: 1,
status: 'draft',
things: 'example1',
},
{
id: 2,
status: 'draft',
things: 'example2',
},
{
id: 3,
status: 'draft',
things: 'example3',
},
]);
await client.items('sample').updateOne(1, {
status: 'approved',
things: 'new example1'
});
await client.items('sample').updateOne(2, {
status: 'approved',
things: 'new example2'
});
await client.items('sample').updateOne(3, {
status: 'approved',
things: 'new example3'
}); At this point, new revisions are OK: we have the correct status, things and ID values. No corruption so far.
await client.items('sample').updateMany([1, 2, 3], { status: 'published' }); The data is still correct in
Corrupted revisions break our entire process, as we use them to display the latest I hope this is enough information to help you solve this issue 😇 |
/linear |
🤖 Linear issue created! Maintainers can access it here: ENG-905 |
Describe the Bug
I noticed when I want to edit multiple items at the same time from the interface, I have a switch of revision between different item updated.
Item Id -> 1
take revision ofItem Id -> 2
Item Id -> 2
take revision ofItem Id -> 1
Strangely, this problem only happens with multiple update on the interface and on certain items.
To Reproduce
Update the status to
Published
on directus:You will see the expected revision for item with ID
505338
:Update something of this item and the problem is resolved:
Errors Shown
No response
What version of Directus are you using?
9.20.4
What version of Node.js are you using?
12.22.12
What database are you using?
Postgres
What browser are you using?
Chrome
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: