BenShelton / oclm-planner

A planner for the OCLM meetings of Jehovah's Witnesses
GNU General Public License v3.0
6 stars 1 forks source link

Weeks sometimes duplicated in the store #36

Open BenShelton opened 5 years ago

BenShelton commented 5 years ago

I've only seen this in a dev environment but it seems sometimes the store doesn't replace existing weeks when they've been updated, causing 2 separate versions of the week to exist.

This may just be a side effect of hot reloading but noting it here in case it crops up again.

My quickest fix for this was to clear the weeks from the store when navigating away from the schedule which isn't a terrible idea and at least provides a way to recover from this. But there should be some safety net that checks for multiple copies of the same week when trying to load, and if there are multiple copies then delete them and fetch a fresh copy again.

It may also be worth thinking about putting some sort of expiry on a week's information in this case, or polling them again after a certain interval. I'm worried about the brothers leaving the page open for days and then coming back to see outdated information. Then that raises the possibility of things like websockets and so on, it depends how far we want to take this.