[Sprint/VacantViper](fix) Live refresh of comments thread on entity change. #1658
Summary
Closes #1658
Comment threads currently do not live refresh, so if the original input entity changes, the thread does not update. This is not problematic for most usecases as the entity is usually fixed, but in situations like the firehose, it changes on approval / rejection.
This meant that when approving and rejecting, the old comments stayed in place on the wrong entity.
Steps to test
- Log in as admin
- Make 5x posts with the content:
adult 1
,adult 2
,adult 3
,adult 4
,adult 5
- Comment on each of these posts (maybe multiple times but not essential)
comment 1
,comment 2
etc - In admin panel, go to firehose
- First entry should be your new post (adult is a keyword watched by the firehose)
- Open the comments - be sure the comment is there.
- Click approve, it should load the next post's comments automatically.
- Try reject, it should do the same.
Estimated Regression Scope
This affects all comment threads on the side, though only in the way of their change detection. Regressions relating to the updating of threads are possible There was an issue I had during development where it was triggering on the initial input, rather than changes, thus duplicating comments and XHR requests.
added scoped label
added scoped label
added scoped label and automatically removed label
- Developer
seen at buddy review
assigned to @benhayward.ben
assigned to @edgebal
- Developer
Seems like the indexing runner is not working correctly on the sandbox.
- Developer
Looks like this sandbox's indexer is still having issues
320 320 } 321 321 322 322 ngOnChanges(changes) { 323 // console.log('[comment:list]: on changes', changes); 323 // console.log('[comment:thread]: on changes', changes); 324 325 // reload on entity change. 326 if (changes.entity && changes.entity.previousValue) { - Developer
In order to avoid unnecessary reloads, can we also check the entity's GUID against the previous value?
added scoped label and automatically removed label