You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so i've got a stateless ListView based widget filled by a viewmodel and a singleton service. when i scroll to the end of the ListView, the widget successfully relays a call to replaceMore() and those new comments pop in to the ListView.
When I scroll to the new bottom and encounter the second MoreComments object, I get an exception. The assertion it fails on suggests to that the insert is being called on a Comment which already exists in the Submission's comment list.
Not sure if this is a bug or pebkac. I don't see how replaceMore could run into a comment that already exists if i'm awaiting it between calls.
[RedditService] loading discussion thread...
[RedditService] found dt: https://redd.itgt9vt5
[RedditService] dt populated: Discussion Thread (75 comments)
... scroll to bottom ...
[DtViewModel] found morecomments: fsab9qd
[RedditService] asked to replace MoreComments objs. status: false currentDt.comments.length=75
[RedditService] replacement complete. status: false currentDt.comments.length=84
... scroll to new bottom ...
[DtViewModel] found morecomments: fsabd63
[RedditService] asked to replace MoreComments objs. status: false currentDt.comments.length=84
[RedditService] 'package:draw/src/models/comment_forest.dart': Failed assertion: line 41 pos 12: '(comment is MoreComments) ||
((comment…
// widget
...
@overrideWidgetbuild(BuildContext context) {
returnScaffold(
appBar:AppBar(
title:Text('DT'),
backgroundColor:Colors.amber,
),
body:ListView.builder(
itemCount:this.vm.dt?.comments?.length ??0,
shrinkWrap:true,
itemBuilder: (context, index){
if (this.vm.dt?.comments ==null) returnconstSizedBox.shrink();
if (this.vm.dt.comments.length <= index) returnconstSizedBox.shrink();
var rawcomm =this.vm.dt.comments[index];
if (rawcomm ==null) returnSizedBox.shrink();
if (rawcomm isMoreComments) {
this.vm.log.v('found morecomments: ${rawcomm.id}');
this.vm.replaceMoreComments();
returnconstSizedBox.shrink();
}
returnCommentCardWidget(TacoComment.fromComment(rawcomm));
},
)
}
}
The text was updated successfully, but these errors were encountered:
inhumantsar
changed the title
MoreComments object not removed from _comments?
replaceMore() assertion error suggests _insertComment operating on an existing comment
May 30, 2020
so i've got a stateless ListView based widget filled by a viewmodel and a singleton service. when i scroll to the end of the ListView, the widget successfully relays a call to
replaceMore()
and those new comments pop in to the ListView.When I scroll to the new bottom and encounter the second MoreComments object, I get an exception. The assertion it fails on suggests to that the insert is being called on a Comment which already exists in the Submission's comment list.
Not sure if this is a bug or pebkac. I don't see how replaceMore could run into a comment that already exists if i'm
await
ing it between calls.The text was updated successfully, but these errors were encountered: