fix(overpass): tag caches by the sorted upstream set and cover installations

Uses a full SHA-256 of the sorted instance list, so reordering the same
instances for failover keeps the cache. Adds the installation-cache repoint
test (tagged, reordered, repointed, untagged, unconfigured) and the changelog
and current-state notes.
This commit is contained in:
Sameh Khamis committed 2026-10-15 10:48:38 -07:00
1 parent 4ede4ebbcd
commit c42b072e99
4 files changed
+39 -4

No files matched your search

+4 -4
View File
@@ -40,10 +40,10 @@ let upstreamMemo = { raw: null, endpoints: [], tag: 'none' };
*/
function upstreamTag(endpoints) {
if (!endpoints.length) return 'none';
return createHash('sha1')
.update(endpoints.join('\n'))
.digest('hex')
.slice(0, 12);
// Sorted, so reordering the same instances for failover keeps the cache.
return createHash('sha256')
.update([...endpoints].sort().join('\n'))
.digest('hex');
}
/** Resolve after environment loading. Public Overpass instances are not used by default. */