   delete sessionContext.syncState
   delete sessionContext.rpcRequest
   sessionContext.declarations = []
-  sessionContext.doneProvisions = 0
+  sessionContext.provisionsRet = []
   if sessionContext.revisions[sessionContext.revisions.length - 1] > 0
     sessionContext.deviceData.timestamps.collapse(1)
     sessionContext.deviceData.attributes.collapse(1)

  if sessionContext.virtualParameters.length == 0 and
      sessionContext.declarations.length == 0 and
      not _declarations?.length and
      (sessionContext.doneProvisions or sessionContext.provisions.length == 0)
    return callback()

  if sessionContext.declarations.length <= sessionContext.virtualParameters.length

  sessionContext.virtualParameters = []
  sessionContext.channels = {}
  sessionContext.declarations = []
  sessionContext.provisionsRet = []
  sessionContext.revisions = [0]
  sessionContext.extensionsCache = {}

