While reading code, I noticed a small typo in syncrep.h. It says SyncRepUpdateSyncStandbysDefined() is called by wal writer whereas its called by the checkpointer process, at least in the HEAD. Previously, it was being called by the bgwriter process.
Attached patches fix this in the relevant releases.