Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reverses the order in which transaction logs are stored and replayed, changing from newest-first to oldest-first (chronological order). This aligns cloud logs replay with the order in which transactions actually occurred.
Key changes:
- Transaction logs are now appended to the end of the array instead of the beginning
- Log trimming now keeps the most recent entries by removing the oldest ones
- SSE initial events now fetch the last N logs instead of the first N logs
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/commons-server/src/libs/server/server.ts | Changes log storage from unshift to push and updates trimming logic to keep the last N transactions |
| packages/commons-server/src/libs/server/admin-api.ts | Updates SSE initial events to fetch the last N logs and adds proper validation for maxLogs parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
It's more correct to emit them in the order in which they were made, instead of reversing the order like in the app view. Closes #1966
dae066f to
73fb9c9
Compare
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.
It's more correct to emit them in the order in which they were made, instead of reversing the order like in the app view. Closes #1966
Technical implementation details
Checklist
Closes #{issue_number}