Skip to content

fix cleanup of waitFor timers when an error occurs during onTimeout printout#1918

Merged
mdjastrzebski merged 12 commits into
callstack:mainfrom
ggilles:fix-timer-cleanup-bug
Jun 23, 2026
Merged

fix cleanup of waitFor timers when an error occurs during onTimeout printout#1918
mdjastrzebski merged 12 commits into
callstack:mainfrom
ggilles:fix-timer-cleanup-bug

Conversation

@ggilles

@ggilles ggilles commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This is an attempt at fixing the timer cleanup bug described in #1917.

Summary

There are 2 fixes in there:

  • added a try/catch around processing onTimeout so that if an error happens while doing so (while dumping the screen for example), timers are still cleaned up
  • added cleanup of running timers when the top level timer expires.

Test plan

I included tests for both cases explained above. Very new to this codebase, so I'm not sure I'm doing it correctly. Forgive me is isn't suitable 🙏 .

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.41%. Comparing base (e5e8e37) to head (64c586a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1918      +/-   ##
==========================================
+ Coverage   98.40%   98.41%   +0.01%     
==========================================
  Files          79       79              
  Lines        1501     1518      +17     
  Branches      414      418       +4     
==========================================
+ Hits         1477     1494      +17     
  Misses         24       24              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mdjastrzebski mdjastrzebski merged commit 66d66fe into callstack:main Jun 23, 2026
29 checks passed
@mdjastrzebski

Copy link
Copy Markdown
Member

@ggilles thank you for finding and fixing these issues 🙌 I've reviewed your PR and added polished some rough edges.

mdjastrzebski added a commit that referenced this pull request Jun 23, 2026
…printout (#1918)

Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com>
@ggilles

ggilles commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@mdjastrzebski Thanks for taking it over 🙏 .

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