title: Service Worker sync event not firing
body: <p>I'm persisting a review posted offline in the indexedDB and registering a sync with the service worker, but once back online, the sync is not firing unless I post a new review. 
  After some research I think it happens due to the chained promises in the event.waitUntil function. Perhaps someone can guide me in the right direction:</p>
  
  <pre><code>self.addEventListener('sync', event =&gt; {
    if (event.tag == 'outbox') {
      event.waitUntil(
        postReview()
      ).catch(err =&gt; {
        if (event.lastChance) {
          self.registration.showNotification('Failed');
        }
        throw err;
      });
    }
  });
  
  
  
  postReview = () =&gt; {
    DBHelper.openDB()
      .then(db =&gt; {
        const tx = db.transaction(['outbox'], 'readonly');
        const store = tx.objectStore('outbox');
        return store.getAll();
      })
      .then(reviews =&gt; {
        return Promise.all(
          reviews.map(review =&gt; {
            const formData = new FormData();
            formData.append('restaurant_id', review.restaurant_id);
            formData.append('name', review.name);
            formData.append('rating', review.rating);
            if (review.comments.value) {
              formData.append('comments', review.comments);
            }
            return fetch(`${DBHelper.REVIEWS_URL}/`, {
              method: 'POST',
              body: formData
            }).then(data =&gt; {
              if (data) {
                return DBHelper.openDB().then(db =&gt; {
                  const tx = db.transaction('outbox', 'readwrite');
                  const store = tx.objectStore('outbox');
                  return store.delete(review.id);
                });
              }
            }).catch((err) =&gt; console.error(err));
          })
        );
      });
  };
  </code></pre>
  
  <p>At all times I'm getting </p>
  
  <pre><code>Cannot read property 'catch' of undefined at self.addEventListener.event (sw.js:97)
  </code></pre>