Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets improved livestreaming performance in the core activities sorting reducer by adding a streaming “fast path” for mid-stream revisions and centralizing an Array.prototype.toSpliced ponyfill in the base utils package.
Changes:
- Added a streaming fast path in
upsertto avoid full recomputation for eligible mid-stream livestream revisions. - Introduced
packages/base/src/utils/toSpliced.tsand exported it viapackages/base/src/utils/index.ts. - Updated core sorting helpers (
upsert.ts,insertSorted.ts) to consume the sharedtoSplicedutility and updatedCHANGELOG.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/reducers/activities/sort/upsert.ts | Adds livestreaming fast path and switches to shared toSpliced. |
| packages/core/src/reducers/activities/sort/private/insertSorted.ts | Removes inline toSpliced wrapper and imports shared util. |
| packages/base/src/utils/toSpliced.ts | Adds a typed ponyfill wrapper around core-js-pure to-spliced. |
| packages/base/src/utils/index.ts | Re-exports toSpliced from base utils barrel. |
| CHANGELOG.md | Adds a changelog entry for the streaming upsert fast path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… check Agent-Logs-Url: https://github.com/microsoft/BotFramework-WebChat/sessions/30b9dd7c-b976-4ae3-9ea3-79247db38e40 Co-authored-by: OEvgeny <2841858+OEvgeny@users.noreply.github.com>
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
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.
Changelog Entry
Description
Improves livestreaming performance by adding a fast path in the activity
upsertreducer. For revision 2..N-1 of an existing, non-finalized livestream session without HowTo grouping, the fast path skips full Map copies,sortedChatHistoryListrecomputation,computeSortedActivities, and full position sequencing reducing each streaming revision from O(n) to O(session_revisions).Design
The fast path activates when all of these conditions are met:
When eligible, position is assigned incrementally from the previous activity's position. If the position increment would collide with the next sibling, it squeezes by +1. If even that collides, it falls through to the existing slow path for full re-sequencing.
Specific Changes
core-js-pure/features/array/to-spliced.jstoSplicedfrom index.tstoSplicedwrapper, imported from base packagetoSplicedwrapper, imported from base packageI have added tests and executed them locallyI have updated documentationReview Checklist
z-index)