FetchCommunity
: various fixes and improvements
#4509
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #4496
Closes #4496
Main changes
Temporal fix for bug: sort order ignored in store nodes waku-org/nwaku#2317 bug.
I made the manager to always fetch all envelopes in the batch (no stop when community was found).
These lines should be removed/reverted when the original bug is fixed:
status-go/protocol/messenger_store_node_request_manager_config.go
Lines 24 to 26 in fdcdec3
status-go/protocol/messenger_storenode_request_test.go
Line 420 in fdcdec3
Check if a desired community already exists in the database and require the fetched community
Clock
to be higher.If no newer information was fethed,
nil
is returned, even if the community exists in the databaseImplement
StoreNodeRequestManager
options:WaitForResponse
StopWhenDataFound
InitialPageSize
FurtherPageSize
This allows a better control over the request. And made it possible to implement the fix (1) tidy.
4. It seems to me that theTestRequestMultipleCommunities
is now less flaky, but still fails at about 1% cases.4. UPD: Fixes
TestRequestMultipleCommunities
flaky testExtracted
DefaultMailserversByFleet
functionSome other minor refactoring and logging
Test improvements
Added a mechanism to wait for the test store node to receive the envelopes.
This was previously leading to bugs, the case is tested with
TestSequentialUpdates
Implemented a test to check the fetched envelopes order:
TestRequestCommunityEnvelopesOrder
This is to address bug: sort order ignored in store nodes waku-org/nwaku#2317 bug, to ensure that our code behaves correctly (assuming that go-waku is also working correctly).
Implemented a
TestFetchRealCommunity
it allows to fetch community from all store nodes in a given fleet and check community state on each store node.