FirebaseExtended / firebase-queue

MIT License
786 stars 108 forks source link

Bug in README.md under Queue Security #59

Open chrisze opened 8 years ago

chrisze commented 8 years ago

In README.md, under Queue Security, the validate rule under rules/queue/tasks contains

newData.hasChildren(['_state', '_state_changed', '_progress']) 

Notice the presence of the _progress property. However, in queue_worker.js, in _resetTask, we have:

if (task._state === self.inProgressState) {
  task._state = self.startState;
  task._state_changed = Firebase.ServerValue.TIMESTAMP;
  task._owner = null;
  task._progress = null;
  task._error_details = null;
  return task;
}

So, if the validate rule does contain the _progress property, the transaction in queue_worker will keep failing because _progress is set to null. We should either update the doc or update queue worker.

Caerbannog commented 7 years ago

Is think that this issue is still applicable: https://github.com/firebase/firebase-queue/blob/master/src/lib/queue_worker.js#L126