diff options
Diffstat (limited to 'common/queryrunner.cpp')
-rw-r--r-- | common/queryrunner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index 2062828..73ccf6d 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp | |||
@@ -77,9 +77,10 @@ QueryRunner<DomainType>::QueryRunner(const Sink::Query &query, const Sink::Resou | |||
77 | // Incremental updates are always loaded directly, leaving it up to the result to discard the changes if they are not interesting | 77 | // Incremental updates are always loaded directly, leaving it up to the result to discard the changes if they are not interesting |
78 | setQuery([=]() { return incrementalFetch(query, bufferType); }); | 78 | setQuery([=]() { return incrementalFetch(query, bufferType); }); |
79 | // Ensure the connection is open, if it wasn't already opened | 79 | // Ensure the connection is open, if it wasn't already opened |
80 | // TODO If we are not connected already, we have to check for the latest revision once connected, otherwise we could miss some updates | ||
81 | mResourceAccess->open(); | 80 | mResourceAccess->open(); |
82 | QObject::connect(mResourceAccess.data(), &Sink::ResourceAccess::revisionChanged, this, &QueryRunner::revisionChanged); | 81 | QObject::connect(mResourceAccess.data(), &Sink::ResourceAccess::revisionChanged, this, &QueryRunner::revisionChanged); |
82 | // open is not synchronous, so from the time when the initial query is started until we have started and connected to the resource, it's possible to miss updates. We therefore unconditionally try to fetch new entities once we are connected. | ||
83 | QObject::connect(mResourceAccess.data(), &Sink::ResourceAccess::ready, this, &QueryRunner::revisionChanged); | ||
83 | } | 84 | } |
84 | mResultProvider->onDone([this]() { | 85 | mResultProvider->onDone([this]() { |
85 | delete this; | 86 | delete this; |