Skip to content

Conversation

@Assem-Uber
Copy link
Contributor

@Assem-Uber Assem-Uber commented Nov 5, 2025

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

  • Created a new WorkflowHistoryGrouper helper
  • It accepts a list of events and only process newly added events
  • Newly added events are split into small batches to control processing load.
  • Pending activities/Decision can be updated on existing groups list
  • If an entry exists in pending activity and does't have a corresponding group yet it is buffered until the group exists

New grouper is not integrated into history page, this will be done in the upcomming PR.

@Assem-Uber Assem-Uber requested a review from Copilot November 10, 2025 13:44
Copy link
Contributor

Copilot AI left a 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 WorkflowHistoryGrouper class 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.

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.

2 participants