Skip to content
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

Add handleCompletePromise helper function #143

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

avillega
Copy link
Contributor

We had some code repetition around handling a completed durable promise. The repetition was fine, how ever this pattern will come to callbacks and tasks and we will have it in atleast 4 more places, having to write that code that many times is error prone and verbose.

This change also fixes a bug made evident by this helper funciton where we were returning the value computed by the function directly instead of the value stored in the completed durable promise.

We had some code repetition around handling a completed durable promise.
The repetition was fine, how ever this pattern will come to callbacks
and tasks and we will have it in atleast 4 more places, having to
write that code that many times is error prone and verbose.

This change also fixes a bug made evident by this helper funciton where
we were returning the value computed by the function directly instead of
the value stored in the completed durable promise.
@avillega avillega requested a review from dfarr August 30, 2024 18:07
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 81.09%. Comparing base (86725f3) to head (f4e5d84).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/core/promises/types.ts 84.61% 2 Missing ⚠️
lib/resonate.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
+ Coverage   79.94%   81.09%   +1.15%     
==========================================
  Files          17       17              
  Lines        1107     1095      -12     
  Branches      300      314      +14     
==========================================
+ Hits          885      888       +3     
+ Misses        222      195      -27     
- Partials        0       12      +12     

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

@avillega avillega merged commit 57af298 into main Aug 30, 2024
2 checks passed
@avillega avillega deleted the avillega/handle-completed-promise branch August 30, 2024 18:13
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.

3 participants