Comments (12)
It's about a TempId
not being resolved to real id in Toolbox side. Using TempIdDict
in entity tree items fixes the issue. I need to still figure out why the corresponding unit test fails - perhaps it needs to wait for the pending changes to take place. The unit test is fixed now as well.
from spine-toolbox.
@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 :)
from spine-toolbox.
I would like to give this one a try @soininen @PiispaH - I believe there is an easy way to implement @soininen 's idea and get rid of the TempIdDict.
from spine-toolbox.
I ran into similar issue while fixing unit tests under #2294.
from spine-toolbox.
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...
from spine-toolbox.
Hopefully the above commit fixes this.
from spine-toolbox.
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...
from spine-toolbox.
This issue still seems to persist for me if the db editor session is not refreshed between adding the items and deleting them.
from spine-toolbox.
Looks like I fixed this only for the Entity tree and not for Parameter value table.
from spine-toolbox.
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...?
from spine-toolbox.
@manuelma Sure, please go ahead! I got distracted and am currently bogged down with some other stuff.
from spine-toolbox.
I think it got solved, will close again...
from spine-toolbox.
Related Issues (20)
- Closing and reopening DB Editor should reload the database HOT 8
- Importing SpineOpt template not working in 0.7 HOT 1
- WSL Package not installed HOT 4
- Undoing after rollback doesn't update Scenario tree HOT 7
- DB editor doesn't load entities when opened HOT 1
- DB editor does not add new classes if they are empty HOT 8
- Strange significant digits when importing HOT 8
- Importer File Selection resets everytime after closing, ignores project.json config HOT 5
- "Add entities" in treeview should offer only relevant entities
- Group member expansion not showing entity names
- Option to sort entity classes by dimensionality HOT 1
- Show the ID of a class icon and colour in DB Editor HOT 2
- Managing elements for 0-dimensional entity classes
- New added entity class changes dimension after opening Toolbox again HOT 5
- DB editor item doesn't come back and causes a Traceback after commit and redo HOT 1
- Parameter value editor does not support non-float array values. HOT 3
- Connect Spinetoolbox to a database server HOT 18
- Changing the alternative of a parameter value associated with a parameter list with non-numeric values causes an error HOT 4
- Cannot delete Base alternative HOT 3
- Feeding tables with fewer columns than expected to importer tracebacks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spine-toolbox.