Skip to content

fix(async): harden async module and add tests#33

Merged
dlyongemallo merged 1 commit intomainfrom
improve_async
Mar 12, 2026
Merged

fix(async): harden async module and add tests#33
dlyongemallo merged 1 commit intomainfrom
improve_async

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 11, 2026 15:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens diffview.async’s core scheduling utilities and adds functional tests that exercise common guard patterns used to abort in-flight async work.

Changes:

  • Add functional specs covering control.Signal semantics and a “closing signal” guard pattern.
  • Add functional specs validating debounce.debounce_trailing behavior under rapid calls.
  • Harden async.timeout and async.scheduler by using explicit callback-parameter counts and handling timer allocation failure.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lua/diffview/tests/functional/async_guards_spec.lua Adds functional coverage for Signal behavior, closing-guard abort patterns, and trailing debounce behavior.
lua/diffview/async.lua Adjusts timeout/scheduler wrapping (explicit param count) and adds a fallback path when uv.new_timer() can’t be created.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/diffview/tests/functional/async_guards_spec.lua
Comment thread lua/diffview/async.lua Outdated
@dlyongemallo dlyongemallo merged commit de9cc3f into main Mar 12, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the improve_async branch March 12, 2026 09:04
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