Skip to content
Source
Sign inSign up
TanStack/db

test(db): tighten includes oracle failure checks #1717

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/1717/headmerged by tannerlinsley

Showing 2 changed files with 84 additions and 35 deletions (loading 1).

x
0 of 2 viewed, 2 left
84 additions and 35 deletionspackages/db/tests/query/includes-oracle.property.test.tsModified
View file
@@ -125,28 +125,22 @@
{ length: 5 },
() => new Map<number, number>(),
- const rolledBackLevels = new Set<HistoryAction[`level`]>()
​
return history.map((action) => {
const keys = keysByLevel[action.level]!
const positions = positionsByLevel[action.level]!
- if (
- rolledBackLevels.has(action.level) &&
- (action.type === `optimisticConfirm` ||
- action.type === `optimisticRollback`)
- ) {
+ const normalizePut = (): HistoryAction => {
keys.add(action.id)
- return { ...action, type: `put` }
- }
- if (action.type === `put`) {
- keys.add(action.id)
const position = positions.get(action.id) ?? action.position
positions.set(action.id, position)
- return { ...action, position }
+ return { ...action, type: `put`, position }
+​