-
Notifications
You must be signed in to change notification settings - Fork 4
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
this.subscriptionsReady() Not Updating #7
Comments
Oh, I have to create a test for this, sounds not so great. Thx for noticing! |
Yep, having the same problem. If my subscriptions change, this.subscriptionsReady() goes not to true anymore. |
@timbrandin any update on this? |
@ralphievolt yeah, this has to do with that we're saving the subscriptions with a jsonified object of the name and arguments, this causes it to save a new one for each time it is updated. @Elviron has started looking at this, https://github.com/Elviron/tracker-component/commit/2ec758a1badfcb05ac412f608c8db0f988ddded3 We should probably just store per name, I did this before though, and I can't remember why I changed it to store subscriptions with all the arguments. PR's are welcome. |
I'm looking forward to a solve on this as well! For those lookin for a bit more detailed code causing this issue. this.autorun(()=> {
const {
listId,
showCompleted,
dispatch
} = this.props;
const showAll = showCompleted || showCompleted===undefined? true:false;
const filters = showAll? 'SHOW_ALL':'SHOW_ACTIVE';
this.subscribe('taskItemsForList', listId, filters);
// #FIXME# changing the subscription caused subscriptionsReady() to return false;
if(this.subscriptionsReady()){
dispatch(fetchTaskItems(listId));
}
else {
dispatch(taskItemsSubscriptionPending(listId));
}
}); |
Any workarounds? I don't understand how to fix this( |
Any updates on this? |
this.autorun(() => { this.setState({ ready: this.subscriptionsReady(),
this.state.ready
once change to false does not update anymore even if I purposely delayed the publication.The text was updated successfully, but these errors were encountered: