-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[PROTOTYPE][User achievements] client-side stream processor #13766
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
Closed
audreyality
wants to merge
92
commits into
main
from
innovation/user-achievements/event-stream-prototype
Closed
[PROTOTYPE][User achievements] client-side stream processor #13766
audreyality
wants to merge
92
commits into
main
from
innovation/user-achievements/event-stream-prototype
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Ideally the name of the icon is present on the achievement configuration. Currently a iconMap is used to lookup the icon by achievementId
…ed it to include the description
…tting the metric update
Member
Author
Innovation sprint concludedThis PR will now be closed. Any lessons learned and ideas can be extracted from the branch, which will not be deleted for now. |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



🛑 This PR is created to share ideas; it will not be merged.
📔 Objective
This User Achievements prototype measures user activity using a reactive stream processor. It uses the measurements to award achievements.
This system includes a reactive control loop to determine which monitors are running. The system can be fully disabled by returning an empty set of monitors.
🔮 Monitors
🫐 Achievement Hub Prototype
The achievement hub combines a collection of functions and types into a full achievement event processor. The following graphic shows a rough illustration of how these parts fit together:
This prototype starts with the ECS schema from #13367. User event monitors collect events into an RXJS subject. The achievement hub listens for new log entries and emits achievement logs from its own subject.
Note
Permanent state is not implemented by the prototype.
✅ The achievement processor measures user events and produces metrics and achievements:
pipe- input - The user event stream.captured$/metrics$- input - The latest collection of measurementsvalidators$- input - The rules for awarding achievementspipe- output - The achievement event stream.👍🏻 The achievement manager determines which achievement measurements are active.
"until-earned"criteria measure the event stream until a matching earned achievement event is tracked.✏️ The event store captures achievement events local to the client. It stores and emits achievement events. Its storage tracks the age of each event and evicts stale events (typically those that track achievement progress).
pipe- input - The local achievement event stream.replication$- input - (not depicted or implemented) Non-local achievement event stream (synced from other clients).pipe- output - The achievement event stream.captured$- output - New log entries observed by the event store.conflicts$- output - (not depicted or implemented) Records recieved fromreplication$that conflict with the local event stream.Important
The prototype doesn't implement an event store. It uses a ReplaySubject to simulate permanent state.
🧠 Assumptions
🦕 Not included
This design was chosen to ensure that we can iterate quickly on the processor during the sprint, and then upgrade to a more robust design for the full release. Some of the features not included in this design:
Integration tests for the completed achievement hub should cover the following scenarios:
🏁 Tasks
🪗 Stretch goals