Fix handling of lastSync to support repopulating a cleared cache