-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(v9/core): Ensure logs past MAX_LOG_BUFFER_SIZE are not swallowed
#18213
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,7 +245,10 @@ describe('_INTERNAL_captureLog', () => { | |
| // Add one more to trigger flush | ||
| _INTERNAL_captureLog({ level: 'info', message: 'trigger flush' }, client, undefined); | ||
|
|
||
| expect(_INTERNAL_getLogBuffer(client)).toEqual([]); | ||
| // After flushing the 100 logs, the new log starts a fresh buffer with 1 item | ||
| const buffer = _INTERNAL_getLogBuffer(client); | ||
| expect(buffer).toHaveLength(1); | ||
| expect(buffer?.[0]?.body).toBe('trigger flush'); | ||
| }); | ||
|
|
||
| it('does not flush logs buffer when it is empty', () => { | ||
|
Comment on lines
245
to
254
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: New logs are silently discarded when the log buffer reaches its maximum size and triggers a flush. 🔍 Detailed AnalysisWhen the log buffer reaches 💡 Suggested FixModify the logic to either check the new buffer size before flushing or ensure the new log is preserved after the buffer is cleared by the flush operation. 🤖 Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. Reference_id: 2693436
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, that's what this PR fixes with ba24997. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.