Skip to content

Commit

Permalink
Force fetching items from database if it has unforeseen commits
Browse files Browse the repository at this point in the history
SpineDBWorker._do_fetch_more() now checks if database has commits from
unknown source before bailing out after iterating the db mapping.
This fixes cases where
1. fetch parent has fetched some data already, e.g. the Base alternative
2. an external source adds more data to the database, e.g. Importer brings
   new alternatives
3. fetch parent never fetches the new items since db worker would bail out
   after iterating the mapping

Re #2353
  • Loading branch information
soininen committed Oct 19, 2023
1 parent b7b6300 commit 07fae8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spinetoolbox/spine_db_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def fetch_more(self, parent):
self._do_fetch_more(parent)

def _do_fetch_more(self, parent):
if self._iterate_mapping(parent):
if self._iterate_mapping(parent) and not self._db_map.has_external_commits():
# Something fetched from mapping
return
item_type = parent.fetch_item_type
Expand Down

0 comments on commit 07fae8e

Please sign in to comment.