Skip to content
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

[Access] Add implementation for events data providers and account statuses data providers #6766

Merged

Conversation

AndriiDiachuk
Copy link
Contributor

@AndriiDiachuk AndriiDiachuk commented Nov 27, 2024

Closes: #6588, #6587

In this PR EventsDataProvider and AccountStatusesDataProvider were implemented.

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 80.07117% with 56 lines in your changes missing coverage. Please review.

Project coverage is 41.09%. Comparing base (66e6db0) to head (f158e6f).

Files with missing lines Patch % Lines
.../rest/websockets/data_providers/events_provider.go 74.22% 18 Missing and 7 partials ⚠️
...ockets/data_providers/account_statuses_provider.go 77.77% 14 Missing and 6 partials ⚠️
.../rest/websockets/data_providers/blocks_provider.go 73.52% 6 Missing and 3 partials ⚠️
...e/access/rest/websockets/data_providers/factory.go 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6766      +/-   ##
==========================================
+ Coverage   41.01%   41.09%   +0.08%     
==========================================
  Files        2104     2107       +3     
  Lines      185030   185286     +256     
==========================================
+ Hits        75892    76151     +259     
+ Misses     102767   102733      -34     
- Partials     6371     6402      +31     
Flag Coverage Δ
unittests 41.09% <80.07%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Comment on lines +111 to +112
blocksSinceLastMessage = 0
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be outside of the check.

Suggested change
blocksSinceLastMessage = 0
}
}
blocksSinceLastMessage = 0

otherwise, it could behave strangely. for example, if heartbeatInterval is 5 and there are 4 empty blocks in a row, blocksSinceLastMessage would be 4. Then if the next block contained events, a message would be sent without resetting blocksSinceLastMessage, so on the next empty block, a heartbeat message would be sent.

looks like we have this bug in all of the places. I opened #6837 to fix this everywhere. you can skip it in this PR

Copy link
Contributor

@Guitarheroua Guitarheroua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Guitarheroua Guitarheroua added this pull request to the merge queue Dec 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 26, 2024
@AndriiDiachuk AndriiDiachuk added this pull request to the merge queue Dec 26, 2024
Merged via the queue into onflow:master with commit 941178d Dec 26, 2024
55 checks passed
@AndriiDiachuk AndriiDiachuk deleted the AndriiDiachuk/6588-events-data-provider branch December 26, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Access] Add implementation for events data providers
5 participants