Skip to content

fix(logger): avoid infinite recursion when isolate log port fails - #1380

Open
sneurlax wants to merge 2 commits into
stagingfrom
fix/logger-recursion
Open

sneurlax wants to merge 2 commits into
stagingfrom
fix/logger-recursion

Conversation

@sneurlax

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented May 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.64%. Comparing base (1e2e4d9) to head (2e675d9).
⚠️ Report is 26 commits behind head on staging.

Files with missing lines Patch % Lines
lib/utilities/logger.dart 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1380      +/-   ##
===========================================
+ Coverage     7.85%    9.64%   +1.78%     
===========================================
  Files         1125     1129       +4     
  Lines       112820   113516     +696     
===========================================
+ Hits          8866    10949    +2083     
+ Misses      103954   102567    -1387     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@julian-CStack julian-CStack left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this could be improved. But I do not thick these requested changes are the solution.

I've talked to someone before about this exact spot but I cannot remember who.

@sneurlax

Copy link
Copy Markdown
Member Author

We talked about this but you might've discussed it with someone else. I made 374c7b8, then you revisited the same block in 2887dc1 and 8c3f6e7. So I see that this is basically a reversion to something you already nACKed and will take another look at it...

@sneurlax
sneurlax force-pushed the fix/logger-recursion branch from 1cb505a to 7b5f665 Compare August 21, 2026 00:51
@sneurlax

sneurlax commented Aug 21, 2026 •

Copy link
Copy Markdown
Member Author

OK, errors are typically written to latest.txt, with emergency.txt used if the former doesn't work, in a portable (cross-platform) way. I still need to test this on the rest of the platforms:

  • Linux
  • macOS
  • Windows
  • Android
  • iOS

@sneurlax
sneurlax force-pushed the fix/logger-recursion branch from b526b92 to 9eb882e Compare August 25, 2026 00:03
When sending to the logger isolate fails, log() reports it through t(),
which sends again. If the port is gone every send fails, so log -> t ->
log recursed until the stack overflowed. Report the failure once; if
that fails too, print the original entry and the error instead.
@sneurlax
sneurlax force-pushed the fix/logger-recursion branch from 9eb882e to 2e675d9 Compare October 13, 2026 16:07
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