question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite Loading FlexTable: Dataset Of One Causes State Problem

See original GitHub issue

Hey there!

I think I found a bug, or… I am just missing something obvious.

Thanks for your work on RV!

Issue Loading a single item list into an Infinite Loading FlexTable prevents any future changes, even after a clearing of state.

My guess would be how the caching is being done, but I wasn’t able to make any headway on that.

Steps

  • Take the Gist below and replace InfiniteLoader.example.js in the RV source with it.
  • Start server, go to InfiniteLoader, etc.
  • Click ‘Only Two’.
    • This should give you only two results.
  • Click ‘Multi-Page’.
    • This should give you a standard Infinite list.
  • Click ‘Clear Data’.
    • This should… clear the data.
  • Try any order combination of those 3 buttons.
    • This should not break anything…
  • Click ‘Only One’.
    • This should give you only one result.
  • Click ‘Only Two’ or ‘Multi-Page’.
    • This should hang at loading.
  • Click ‘Clear Data’.
    • This should clear the table, but no further button clicks will load results.

tl;dr - Once a result of a single row is loaded you can’t un-stick it.

// Line 39: If you change this...
const rowCount = hasNextPage ? list.size + 1 : list.size;
// Into this...
const rowCount = hasNextPage ? list.size + 2 : list.size;
// But you are left with an extra loading row showing.

Example Gist

❤️

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
SpencerCarstenscommented, Aug 31, 2016

I’d need to know more info about your particular situation I guess. I don’t know why using componentDidUpdate to look for a changed prop (or props) wouldn’t work. 😄

Well, it does work, but not ideally. 😛 _loadMoreRows gets called twice, and therefore does two API calls ( your gist does this as well ). Granted, this can be worked around by making a check for it being an initial call or something like that. I was just hoping to have to avoid that kind of thing. 😄

1reaction
SpencerCarstenscommented, Aug 31, 2016

I was thinking, how would you feel about a public function on InfiniteLoader to clear the memoized data? The reason I ask is that I’ve ran into another snag, but this time with a result set of zero. While I can get around it by forcing this._loadMoreRows using componentDidUpdate, managing when ( much more importantly when not! ) to do that is hairy ( in my situation at least ). Being able to clear the memoized cache manually when I call my this._clearData() function would be ideal ( for me at least ).

Read more comments on GitHub >

github_iconTop Results From Across the Web

InfiniteLoader#loadMoreRows invoked multiple times per scroll
Upon scrolling, InfiniteLoader#loadMoreRows is invoked multiple ... Infinite Loading FlexTable: Dataset Of One Causes State Problem #361.
Read more >
I'm having trouble loading the 'flextable' package. - General
I've come across a few proposed solutions on stackoverflow and in github issues, but I haven't been able to find a solution to...
Read more >
Package 'data.table' - R Project
It offers fast and memory efficient: file reader and writer, aggregations, updates, equi, non-equi, rolling, range and interval joins, in a ...
Read more >
Fixed- and Mixed-Effects Regression Models in R
In a first step, we load functions that we may need (which in this ... If unchecked, then such issues could go unnoticed...
Read more >
Extreme Management Center®Known Restrictions and ...
Problem 6: Extreme Management Center does not support restoring a database that was saved on a Linux system to a Windows system. Problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found