Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache-clean test #6

Closed

Conversation

timmywil
Copy link
Contributor

@timmywil timmywil commented Aug 29, 2016

Changes are more easily viewed with ?w=1.

  • The cache-clean test expected photos to be cached by the time it got a response,
    but the service worker is responding before the put to the cache has completed. Adding a short timeout before checking the cache fixes the issue, while still allowing the sw to respond immediately.
  • This was frustrating because my code was right and the test kept failing. This should fix it for any future students.

- The cache-clean test expected photos to be cached by the time it gets a response,
  but the service worker is responding before the put to the cache has completed.
@jakearchibald
Copy link
Owner

Fixed with d795679

Consuming the image as a blob is the bit that I was missing, that means the rest of my code runs once the image has been fully fetched. Added a 500ms delay just to be sure.

Thanks for spotting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants