Skip to content

Commit d9394ce

Browse files
committed
Removed changes to PartialChangeUnifier
1 parent 7f4955f commit d9394ce

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

core/backend/src/PartialChangeUnifier.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ class InMemoryCache implements ChangeCache {
8282
}
8383

8484
public *all(): IterableIterator<ChangeInstance> {
85-
for (const instance of this._cache.values()) {
86-
yield instance;
85+
for (const key of Array.from(this._cache.keys()).sort()) {
86+
const instance = this._cache.get(key);
87+
if (instance)
88+
yield instance;
8789
}
8890
}
8991

@@ -154,7 +156,7 @@ class SqliteBackedCache implements ChangeCache {
154156
SELECT JSON_GROUP_ARRAY(JSON([value]))
155157
FROM (
156158
SELECT [value],
157-
SUM(LENGTH([value])) OVER (ORDER BY rowid ROWS UNBOUNDED PRECEDING) / ${this.bufferedReadInstanceSizeInBytes} AS [bucket]
159+
SUM(LENGTH([value])) OVER (ORDER BY [key] ROWS UNBOUNDED PRECEDING) / ${this.bufferedReadInstanceSizeInBytes} AS [bucket]
158160
FROM ${this._cacheTable}
159161
)
160162
GROUP BY [bucket]`;

0 commit comments

Comments
 (0)