cube-js/cube

useCubeQuery returns stale result even if resetResultSetOnChange is set

开放

#5,289 创建于 2022年9月13日

 (5 条评论) (2 个反应) (0 位负责人)Rust (1,965 个派生)batch import
client:corehelp wanted

仓库指标

星标
 (19,563 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Describe the bug Changing the query passed to useCubeQuery causes the latter to return the old value even if resetResultSetOnChange is set to true

To Reproduce Steps to reproduce the behavior:

  1. Create some query and pass it to useCubeQuery, then log both the query and the results, something like this
const result = useCubeQuery(query, { resetResultSetOnChange: true })

console.log('Test query: ', query)
console.log('Test result: ', result)
  1. Change the query in any way, eg. user interaction
  2. See logs

Expected behavior I expect the resultSet to be null if the passed query has changed (I guess isLoading should be true, either)

Screenshots You can see from the following screenshot that even though the query changed (there's a filter in the second one), the returned resultSet is the same (actually the whole object is the same), then after a third render the result is the one expected (last two lines).

image

Version: 0.30.64

贡献者指南