Freecodecamp: Handle Client Updates Gracefully - (Offline Mode)

Created on 18 Sep 2020  路  5Comments  路  Source: freeCodeCamp/freeCodeCamp

At the minute the client application is *almost* a PWA with some offline abilites, thanks to out-of-the-box implementations that come with Gatsby.

We also have implementation that notifies users when the API goes offline. It even attempts to post progress updates to the API when back online. You are able to test this by loading up /learn and turning off your internet.

This feature is not quite polished.

We could implement and make use of some of the tools and modern web features available:

  1. Bring back the SW integration which we removed in the past, to fetch new client build and ask user to reload the page.
  2. Talk to the API with a SW instead of using the main thread.
  3. Cache next challenges proactively (Gatsby does this for us automatically, but we could help it help us).
  4. Enable ability to install /learn as an app. This is already enabled on the forum via PWA.
  5. Drop the hosted sign-in and use async UX with Auth0.
  6. The client-side error handling is bit of a mess.
  7. ... other things I will add here with pointers to code.
on the roadmap feature request

Most helpful comment

Oooh... this is really interesting and I'd love to give a hand! I have prior experience with writing SW from scratch. I might need some help here and there but I'd like to give it a go.

All 5 comments

Oooh... this is really interesting and I'd love to give a hand! I have prior experience with writing SW from scratch. I might need some help here and there but I'd like to give it a go.

I completed the first feature in this list. Should I add the other features listed here on the same PR or should I open a PR for each?

I would go with multiple PRs if the features are independent. Otherwise it's fine to have a large PR as long as we organise the commits before merging.

Hi folks, just getting caught up on my notifications.

I should have mentioned that there are several diligent validations need to be done before we jump to any implementation. There are a few reasons that we had chosen to left it midway.

One of them being issues with the gatsby-offline-plugin being notorious for some reason I do not remember of the top of my head.

Feel free to experiment, but it would be a while before we are able to put all the analysis in this thread and a plan for the implementation. For now this is marked on the roadmap.

I found some info about SW related issue here #35259. Just saying it here to keep all of it in one place.

Was this page helpful?
0 / 5 - 0 ratings