Instantsearch.js: When using TransformData on hits, the items are not redrawn

Created on 3 Sep 2017  路  5Comments  路  Source: algolia/instantsearch.js

When using transformData on the hits widget, there's an issue of caching that makes the item not being redrawn.

To reproduce, you can build a regular search where you use transformData to add a timestamp of Date.now and display this value on the hits-template.
Then, when you do another search, all of the results that were present in the previous result set in the same position won't be re-rendered, despite having a different timestamp.

We used to have the same issue on instantsearch v1, and @vvo had fixed it.

Bug

Most helpful comment

Some linked pointers:

  • Bug: Hit not re-rendered when you modify the data in transformData #1538
  • fix(transformData): always call transformData #1555

All 5 comments

Some linked pointers:

  • Bug: Hit not re-rendered when you modify the data in transformData #1538
  • fix(transformData): always call transformData #1555

@kokliKo I tried to reproduce on jsFiddle but was unable to do it. Can you help me? I might have missed one key element.

@kokliKo based on this morning discussion I updated the jsFiddle to do the following: add a transformData for item that injects a Data.now() and use an hogan template to display the value. But I still can't reproduce what you described.

Hey, thanks @bobylito for trying it!
I also tried multiple times to reproduce it and can't get it to work... :/
I can't explain what happened last time.
Sorry for the time spent trying to troubleshoot this one.

@kokliKo no worries 鉂わ笍. Don't hesitate to reopen the issue if you find something.

Was this page helpful?
0 / 5 - 0 ratings