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

Log the errors before we return them from ChannelManager::do_accept_inbound_channel #2807

Conversation

Jossec101
Copy link
Contributor

This closes #2754

@Jossec101 Jossec101 force-pushed the log-errors-do-accept-inbound-channel branch 2 times, most recently from e97bfc2 to 66c9b68 Compare December 29, 2023 02:15
@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (15b7f66) 88.45% compared to head (dbe69ba) 88.42%.
Report is 11 commits behind head on main.

Files Patch % Lines
lightning/src/ln/channelmanager.rs 76.19% 3 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2807      +/-   ##
==========================================
- Coverage   88.45%   88.42%   -0.04%     
==========================================
  Files         114      114              
  Lines       91814    91962     +148     
  Branches    91814    91962     +148     
==========================================
+ Hits        81218    81313      +95     
- Misses       8103     8136      +33     
- Partials     2493     2513      +20     

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

@TheBlueMatt
Copy link
Collaborator

When you address the above comment, feel free to squash, but please update the commit message to be no longer than ~70 chars in the title, and follow it with a small body explaining why we're doing this and what we're doing, with each line wrapped to no longer than ~70 chars.

@Jossec101
Copy link
Contributor Author

Jossec101 commented Jan 8, 2024

I've added WithContext let me know if you want me to rebase or something. I'm not sure if the temporary_channel_id should be used for ChannelId parameter of from(logger: &'a L, peer_id: Option<PublicKey>, channel_id: Option<ChannelId>)

EDIT: Squash ✅

@Jossec101 Jossec101 force-pushed the log-errors-do-accept-inbound-channel branch 2 times, most recently from 2d92b55 to 935145a Compare January 9, 2024 10:18
This refactor ensures that all API errors in do_accept_inbound_channel
are logged before they are returned.
@Jossec101 Jossec101 force-pushed the log-errors-do-accept-inbound-channel branch from 935145a to dbe69ba Compare January 9, 2024 10:26
Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

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

The code looks great!
However we can still improve the commit subject a little.
Using an imperative tone in the subject is considered to be the best practice.

Also, you can refer to this, which will help you educate yourself on best practices in commit writing.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Indeed, the commit message could include a bit more detail, but its probably not worth delaying the PR further to wait on it, its fine enough :)

There's also no need to wait on a third reviewer here, this doesn't change the logic flow anywhere or the API, only adds logging.

@TheBlueMatt TheBlueMatt merged commit 52c2253 into lightningdevkit:main Jan 9, 2024
14 of 15 checks passed
@Jossec101 Jossec101 deleted the log-errors-do-accept-inbound-channel branch January 9, 2024 20:10
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.

Log the errors before we return them from ChannelManager::do_accept_inbound_channel
4 participants