fix(certificate-management): Fix loss of route update callback during dynamic route updates in certificate manager

This commit is contained in:
2025-05-18 23:07:31 +00:00
parent ba1569ee21
commit 8fd861c9a3
6 changed files with 422 additions and 33 deletions

View File

@ -70,11 +70,22 @@ When `updateRoutes()` creates a new SmartCertManager instance, it fails to set t
```
### Success Criteria
- [ ] ACME certificate acquisition works after route updates
- [ ] No "No route update callback set" errors occur
- [ ] All tests pass
- [ ] Documentation clearly explains the behavior
- [ ] Code is more maintainable and less prone to regression
- [x] ACME certificate acquisition works after route updates
- [x] No "No route update callback set" errors occur
- [x] All tests pass
- [x] Documentation clearly explains the behavior
- [x] Code is more maintainable and less prone to regression
### Implementation Summary
The bug has been successfully fixed through the following steps:
1. **Bug Fix Applied**: Added the missing `setUpdateRoutesCallback` call in the `updateRoutes` method
2. **Tests Created**: Comprehensive test suite validates the fix and prevents regression
3. **Documentation Updated**: Added section on dynamic route updates to the certificate management guide
4. **Code Refactored**: Extracted certificate manager creation into a helper method for better maintainability
The fix ensures that when routes are dynamically updated, the certificate manager maintains its ability to update routes for ACME challenges, preventing the "No route update callback set" error.
### Timeline
- Phase 1: Immediate fix (30 minutes)