-
Notifications
You must be signed in to change notification settings - Fork 124
feat: Create a grouping utility that only parses new events #1065
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
base: master
Are you sure you want to change the base?
feat: Create a grouping utility that only parses new events #1065
Conversation
Signed-off-by: Assem Hafez <[email protected]>
Signed-off-by: Assem Hafez <[email protected]>
Signed-off-by: Assem Hafez <[email protected]>
Signed-off-by: Assem Hafez <[email protected]>
Signed-off-by: Assem Hafez <[email protected]>
Signed-off-by: Assem Hafez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a stateful workflow history events grouper with incremental processing capabilities. The implementation allows efficient batch processing of history events with progress tracking through subscriptions.
- Adds
WorkflowHistoryGrouperclass for incremental event processing with batch support - Implements buffering mechanism for pending events that arrive before their scheduled events
- Includes comprehensive test suite with 18 test cases covering various scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/views/workflow-history/helpers/workflow-history-grouper.types.ts | Defines TypeScript types for the grouper including state management, callbacks, and configuration options |
| src/views/workflow-history/helpers/workflow-history-grouper.ts | Core implementation of the stateful grouper with batch processing, event buffering, and subscription management |
| src/views/workflow-history/helpers/tests/workflow-history-grouper.test.tsx | Comprehensive test suite covering grouping logic, pending event handling, buffering, and state management |
| src/views/workflow-history/fixtures/workflow-history-pending-events.ts | Adds factory functions for creating test fixtures dynamically for pending activities and decisions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/views/workflow-history/helpers/__tests__/workflow-history-grouper.test.tsx
Outdated
Show resolved
Hide resolved
src/views/workflow-history/helpers/workflow-history-grouper.types.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…pes.ts Co-authored-by: Copilot <[email protected]>
Summary
The existing grouping utility needs to process all events for each new page received. Also it does the same on each periodical fetching of pending activities. This computation is costly and degrades the web page performance. Solution is to have a new utility that can have events list and only add the new ones to the existing events group.
Changes
WorkflowHistoryGrouperhelperNew grouper is not integrated into history page, this will be done in the upcomming PR.