Multi-query seems to not update cache for boolean value.
See original GitHub issueI have a storage item:
map T:Account => bool
I use a .multi
query to fetch the boolean value for all the members. This multi-query seems to update when the value goes from false -> true, but does not update when going from true -> false.
(It may be relevant to note that we never actually store false
, we just remove the storage item, but it should return false on default).
You can see the behavior here with inline comments:

The image shows:
- Initially both users are suspended (
[true, true]
), (correct) - We un-suspend one of them
- A new
.multi
query still returns[true, true]
, (incorrect) - If you query the value of the un-suspended member separately, you get
false
(correct) - Then if you multi-query again, you get the correct result of
[false, true]
. (correct)
Not this issue does not appear when going from false
-> true
. Only true
-> false
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Subscription to multiple entries in a double map does not ...
Subscription to multiple entries in a double map does not reflect calls to remove_prefix #1417 ... Multi-query seems to not update cache for...
Read more >java - Updating a boolean value in multithreaded process
Multiple threads are trying to access that boolean at the same time: a race condition while updating the same variable.
Read more >MySQL bugs fixed by Aurora MySQL database engine ...
Bug #25289359 : A full-text cache lock taken when data is synchronized was not released if the full-text cache size exceeded the full-text...
Read more >Server-side caching - Apollo GraphQL Docs
Our philosophy behind Apollo Server caching is that a response should only be considered cacheable if every part of that response opts in...
Read more >Multi-match query | Elasticsearch Guide [8.5]
query.bool.max_clause_count setting, which defaults to 4096 . For multi-match queries, the number of clauses is calculated as the number of fields ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In polkadot-js stuff, we generally stay about from the above hooks when dealing with anything UI. In cases where it is re-usable and especially when it is useful to others, we move them to derives where we use RxJs.
For instance, the logic for the society member retrieval - https://github.com/polkadot-js/api/blob/master/packages/api-derive/src/society/member.ts#L23 (Still early, but should give through the concept of the splits employed there)
Can also ve done with the promise-specific
api.combineLatest
(which basically does whatcombineLatest
does, with subscriptions and unsubscribes so it updates and the status changes)This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.