Fix things in REMOVING state initialize instead of getting removed #2828
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This solves eclipse-archived/smarthome#942
If a thing changes its status to REMOVING when it is not initialized the thing cannot be removed because
handleRemoval
cannot be called on an uninitialized handler. This is likely to happen when a binding is not available. When the binding becomes available again, theThingManager
erroneously changed the thing status to INITIALIZING and the thing handler get's initialized and ONLINE later. This PR callsinitialize
on the handler (sohandleRemoval
can be called later) but preserves the REMOVING status. When theThingHandler
tries to change the status to ONLINE,handleRemoval
is called and the thing finally removed.IMO #2517 should be closed if this is merged, as it is expected that either
handleRemoval
is called or the thing is force removed.Signed-off-by: Jan N. Klug github@klug.nrw