Skip to content

Commit

Permalink
DataSync. fixed type error in recordMatchesQuery
Browse files Browse the repository at this point in the history
in the branch for LiteralExpression the expression was not correctly unpacked. This resulted in evaluateDynamicValue returning undefined. This resulted in recordMatchesQuery sometimes returning true when it shouldn't.

In practise this means that on a createRecord call, sometimes a record will be added to a useQuery result optimistically, even when the query would not match that record.
  • Loading branch information
mpscholten committed Nov 14, 2024
1 parent 31cb479 commit fc6180b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/IHP/DataSync/ihp-querybuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export function recordMatchesQuery(query, record) {
default: throw new Error('Unsupported operator ' + expression.op);
}
}
case 'LiteralExpression': return evaluateDynamicValue(expression);
case 'LiteralExpression': return evaluateDynamicValue(expression.value);
case 'ListExpression': return expression.values.map(value => evaluateDynamicValue(value));
default: throw new Error('Unsupported expression in evaluate: ' + expression.tag);
}
Expand Down

0 comments on commit fc6180b

Please sign in to comment.