         self.isUpdatingLockState = true
         print("INFO: Updating the lock state: \(shouldLock ? "LOCKED" : "UNLOCKED").")
 
-        reportLockAction(shouldLock)
-
         if let state = self.targetLockState {
             state.writeValue(shouldLock ? 1 : 0) { error in
                 if error != nil {

        }
    }

    private func reportLockAction(_ shouldLock: Bool) {
        var request = URLRequest(url: LockViewController.REPORT_URL)
        request.httpMethod = "POST"
        request.httpBody = try! JSONSerialization.data(withJSONObject: ["type": "manualLock", "locked": shouldLock])
        request.addValue("application/json", forHTTPHeaderField: "Content-Type")
        let task = URLSession.shared.dataTask(with: request) { data, response, error in
            guard let data = data, error == nil else {

        self.isUpdatingLockState = false
        self.updateLockButtonImages()

        self.reportLockStateChange()

        print("INFO: Lock state updated: \(self.isLocked ? "LOCKED" : "UNLOCKED").")
    }

