Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"新帖"列表懒加载bug #52

Open
YunzheZJU opened this issue Jul 9, 2020 · 0 comments
Open

"新帖"列表懒加载bug #52

YunzheZJU opened this issue Jul 9, 2020 · 0 comments

Comments

@YunzheZJU
Copy link

"新帖"页主题列表存在bug。

环境

  • MacOS 10.15.5
  • Chrome 83.0.4103.116 64bit

复现步骤

  1. 新建标签页A,打开/newTopics,用于复现bug
  2. 新建标签页B,打开/newTopics,用于同步”新帖“内容
  3. 每隔1分钟刷新标签页B,直到出现n个新帖
  4. 激活标签页A,快速滚动列表至底部数次(约10次)
  5. 此时Spinner"正在加载"将持续显示于视口,无网络请求发出
  6. 缓慢上下滚动列表数次,发现每次滚动都会触发1次UtilgetAllNewTopic 调用及其衍生请求,但列表内容无更新
  7. 改变n的值,或每隔数分钟令标签页A加载一次新帖,再滚动至底部,将触发更多神奇现象。最差的情况会出现列表无限循环加载

可能的问题源

这个if Guard完全没有考虑现实中newTopic会更新的情况。一旦在加载完所有新帖前,后端收到1个新帖,getAllNewTopic就迟早会拿回来重复的主题内容,this.state.from就永远不可能达到预想的上限值。

可能的解决方案

getAllNewTopic 此Util的from参数类型修改为主题帖id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant