'Marks all users that had been marked as syncing by a given process
as offline.
Used when the process has stopped/disappeared.'

@defer.inlineCallbacks
def update_external_syncs_clear(self, process_id):

    with (yield self.external_sync_linearizer.queue(process_id)):
        process_presence = self.external_process_to_current_syncs.pop(process_id, set())
        prev_states = (yield self.current_state_for_users(process_presence))
        time_now_ms = self.clock.time_msec()
        (yield self._update_states([prev_state.copy_and_replace(last_user_sync_ts=time_now_ms) for prev_state in prev_states.itervalues()]))
        self.external_process_last_updated_ms.pop(process_id, None)
