Skip to content

fix: start background tasks when activating extensions at runtime#3333

Merged
dni merged 2 commits into
lnbits:devfrom
echennells:fix-extension-activation-background-tasks
Sep 2, 2025
Merged

fix: start background tasks when activating extensions at runtime#3333
dni merged 2 commits into
lnbits:devfrom
echennells:fix-extension-activation-background-tasks

Conversation

@echennells
Copy link
Copy Markdown
Contributor

When extensions are activated after boot (not during startup), their background tasks were not being started. This caused extensions to only partially work - HTTP endpoints would function but background processing (like payment listeners) would not run.

This fix adds the missing call to start_extension_background_work() in the activate_extension function, ensuring extensions activated at runtime have full functionality.

When extensions are activated after boot (not during startup), their
background tasks were not being started. This caused extensions to only
partially work - HTTP endpoints would function but background processing
(like payment listeners) would not run.

The bug was introduced during refactoring in commit 5f4f128 when
activate_extension was moved to a new module but the call to start
background tasks was omitted.

This fix adds the missing call to start_extension_background_work()
in the activate_extension function, ensuring extensions activated at
runtime have full functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@dni dni requested review from dni and motorina0 August 23, 2025 10:10
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 23, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.33%. Comparing base (8272147) to head (7e19759).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
lnbits/core/services/extensions.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3333      +/-   ##
==========================================
- Coverage   57.33%   57.33%   -0.01%     
==========================================
  Files         113      113              
  Lines       14323    14324       +1     
==========================================
  Hits         8212     8212              
- Misses       6111     6112       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@motorina0
Copy link
Copy Markdown
Collaborator

Thanks!
Looks like a valid issue, I will test it.

Copy link
Copy Markdown
Collaborator

@motorina0 motorina0 left a comment

Choose a reason for hiding this comment

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

tested ok

@dni dni merged commit 918add5 into lnbits:dev Sep 2, 2025
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