-
Notifications
You must be signed in to change notification settings - Fork 17
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
Entities/parameter values deleted from DB still visible #2295
Comments
I ran into similar issue while fixing unit tests under #2294. |
Thanks for reporting and please let me know if you need help understanding the new code. Committing has changed considerably so I am not surprised to see something like this... |
It's about a |
Hopefully the above commit fixes this. |
Very nice catch @soininen I am thinking that something like this can also affect the parameter tables and maybe the pivot table, and basically every Qt model where we store DB ids. It makes me wonder... The TempId approach is nice in the sense it removes the need to access the DB for creating new items, but at the same time it might be a bit too crazy. What worries me is clients will need to import and use this TempIdDict guy everytime they'd want to develop something that stores DB ids... Maybe we need to think about this more... Maybe I can present the issue in the next dev meeting and we can all brainstorm... |
@manuelma How about we never change the client-side id, not even when the item is committed? The db map could store the real id in the cache item or keep a lookup table on client id <--> real id transformations. This way we wouldn't need to notify clients at all. Well, that's just one idea. In any case, I'm still undecided what to think about the TempIdDict stuff. What I'm sure of is that we should stop hijacking this issue's discussion :) |
This issue still seems to persist for me if the db editor session is not refreshed between adding the items and deleting them. |
Looks like I fixed this only for the Entity tree and not for Parameter value table. |
Every Qt model must be affected by this, because we store DB ids in their internal data structure. We need to use a TempIdDict everywhere instead (and I don't know how will that work for the parameter tables where the id is stored in a list rather than a dict). I like @soininen 's idea about never resolving ids and instead keeping a mapping from real-id to temp-id somewhere in DatabaseMapping or DBCacheBase...? |
@manuelma Sure, please go ahead! I got distracted and am currently bogged down with some other stuff. |
I think it got solved, will close again... |
The text was updated successfully, but these errors were encountered: