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

feat(events): improve event mapping #543

Merged
merged 6 commits into from
Apr 12, 2023
Merged

feat(events): improve event mapping #543

merged 6 commits into from
Apr 12, 2023

Conversation

glevco
Copy link
Contributor

@glevco glevco commented Mar 17, 2023

This PR changes the way EventManager transmits events. Instead of passing HathorEvents from PubSub directly to the EventStorage and the client WebSocket, it now converts the events to a new EventType enum that has been created.

This allows for decoupling event types between internal events published via PubSub and what we actually want to expose as an interface to our clients, clearing up confusion related to event names and improving proximity to what was described in the original design. This also allowed bringing back events that were previously removed, as they are now separate events mapped from PubSub events.

Acceptance Criteria:

  • New EventType enum replaces HathorEvents as the type for BaseEvent
    • LOAD_STARTED event has been brought back, but mapped from existing MANAGER_ON_START event from PubSub.
    • NEW_VERTEX_ACCEPTED is now emitted instead of NETWORK_NEW_TX_ACCEPTED, as it's mapped from it.

@glevco glevco self-assigned this Mar 17, 2023
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #543 (41670f7) into dev (41670f7) will not change coverage.
The diff coverage is n/a.

❗ Current head 41670f7 differs from pull request most recent head 356fe0b. Consider uploading reports for the commit 356fe0b to get more accurate results

@@           Coverage Diff           @@
##              dev     #543   +/-   ##
=======================================
  Coverage   83.22%   83.22%           
=======================================
  Files         211      211           
  Lines       18673    18673           
  Branches     2593     2593           
=======================================
  Hits        15541    15541           
  Misses       2564     2564           
  Partials      568      568           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@glevco glevco force-pushed the feat/event-mapping branch from f91c155 to 6b5bbb3 Compare April 3, 2023 17:44
@glevco glevco force-pushed the feat/event-mapping branch from 6b5bbb3 to 356fe0b Compare April 11, 2023 17:06
@glevco glevco merged commit 4b07b69 into dev Apr 12, 2023
@glevco glevco deleted the feat/event-mapping branch April 12, 2023 15:48
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.

3 participants