Skip to content

wp: fix behavior of transitions before advanced for first time

P V requested to merge pvir/wireplumber:transition-fix into master

wp_transition_get_completed incorrectly returns TRUE for transitions that have not been advanced at least once, and hence are obviously not completed. This is because transitions start at STEP_NONE, and completed transition is also indicated by STEP_NONE.

Fix this by adding a private flag to track whether transition was started.

Fixes object managers sometimes missing object-changed events. How that happens is the following:

  • object activation transitions are advanced in idle callback
  • they are aborted on registry global removal events
  • registry global removal event can arrive before the idle callback
  • wp_object_abort_activation uses wp_transition_get_completed to determine whether transition was completed, and thinks the completion callback was already triggered
  • object-manager.c:on_proxy_ready is then never triggered for the transition
  • pending_objects counter does not get decremented
  • WpObjectManager is left in the pending state, and never emits installed/objects-changed signals

Fixes #212 (closed), !332 (closed)

Edited by P V

Merge request reports