diff --git a/GRDB/ValueObservation/ValueObserver.swift b/GRDB/ValueObservation/ValueObserver.swift index a6e9dc609..2e81fd793 100644 --- a/GRDB/ValueObservation/ValueObserver.swift +++ b/GRDB/ValueObservation/ValueObserver.swift @@ -114,9 +114,7 @@ extension ValueObserver: TransactionObserver { }) } else { // Concurrent fetch - fetchedValue = writer.concurrentRead { - return try self.reducer.fetch($0) - } + fetchedValue = writer.concurrentRead(reducer.fetch) } // Wait for future fetched value in reduceQueue. This guarantees: @@ -154,21 +152,13 @@ extension ValueObserver { var region = DatabaseRegion() let result = try db.recordingSelection(®ion, fetch) + // Don't record views, because they are never exposed to the + // TransactionObserver protocol. + // // Don't record schema introspection queries, which may be // run, or not, depending on the state of the schema cache. - // - // This gives us a quick way to make sure that the observation - // below, which runs schema introspection queries as a side effect, - // only tracks the "player" table: - // - // let observation = ValueObservation.tracking { db in - // try Player.fetchOne(db, key: 1) - // } - // - // Strictly speaking, this prevents the recording of all schema - // queries. But we assume, until proven wrong, that such recording - // isn't needed by anyone. observedRegion = try region.ignoringViews(db).ignoringInternalSQLiteTables() + return result } else { return try fetch()