code: async def commit(
          request: web.Request, session: UpdateSession) -> web.Response:
      
      if session.stage != Stages.DONE:
          return web.json_response(
              data={'error': 'not-ready',
                    'message': f'System is not ready to commit the update '
                    f'(currently {session.stage.value.short})'},
              status=409)
      with dbus_actions.unmount_boot():
          write_file(os.path.join(session.download_path, BOOT_NAME),
                     constants.BOOT_PARTITION_NAME,
                     lambda x: None)
  
      session.set_stage(Stages.READY_FOR_RESTART)
  
      return web.json_response(
          data=session.state,
          status=200)
docs: Serves /update/:session/commit