simple list of pds servers with open registration
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix user count bug, filter dead servers

- listRepos cursor is always present on non-empty pages, so check
repos.length >= 1000 instead of cursor presence
- Only list servers that responded to health endpoint (version != null)
- Smarter enrichment queue: never-enriched > missing user count >
working > dead
- Per-server logging in cron for easier debugging
- Remove one-time reset (already executed)

+17 -4
+9 -3
backend/database/queries.ts
··· 104 104 SELECT url FROM ${SERVERS_TABLE} 105 105 WHERE is_open = 1 106 106 ORDER BY 107 - CASE WHEN user_count IS NULL THEN 0 ELSE 1 END, 107 + CASE WHEN last_enriched IS NULL THEN 0 108 + WHEN version IS NOT NULL AND user_count IS NULL THEN 1 109 + WHEN version IS NOT NULL THEN 2 110 + ELSE 3 111 + END, 108 112 last_enriched ASC NULLS FIRST 109 113 LIMIT ? 110 114 `, ··· 137 141 orderClause = "user_count DESC NULLS LAST"; 138 142 } 139 143 140 - let whereClause = "is_open = 1 AND last_enriched IS NOT NULL"; 144 + // Only show servers that actually responded (have version from health endpoint) 145 + let whereClause = 146 + "is_open = 1 AND last_enriched IS NOT NULL AND version IS NOT NULL"; 141 147 const args: (string | number)[] = []; 142 148 143 149 if (!showOutdated && latestVersion) { ··· 166 172 167 173 export async function getAllServers(): Promise<PdsServer[]> { 168 174 const result = await sqlite.execute( 169 - `SELECT * FROM ${SERVERS_TABLE} WHERE is_open = 1 ORDER BY user_count DESC NULLS LAST`, 175 + `SELECT * FROM ${SERVERS_TABLE} WHERE is_open = 1 AND version IS NOT NULL ORDER BY user_count DESC NULLS LAST`, 170 176 ); 171 177 return result.rows.map(rowToServer); 172 178 }
+2 -1
backend/services/pds-enricher.ts
··· 137 137 } 138 138 const data = await resp.json(); 139 139 const repos: unknown[] = data.repos ?? []; 140 - return data.cursor ? 1000 : repos.length; 140 + // If we got exactly 1000 repos, there are likely more 141 + return repos.length >= 1000 ? 1000 : repos.length; 141 142 } catch (err) { 142 143 console.error(`listRepos ${url}: ${err}`); 143 144 return null;
+6
cron/refresh.cron.ts
··· 59 59 countryName: data.countryName, 60 60 ipAddress: data.ipAddress, 61 61 }); 62 + const host = new URL(data.url).hostname; 63 + console.log( 64 + ` ${host}: users=${data.userCount ?? "?"} country=${ 65 + data.countryCode ?? "?" 66 + } version=${data.version ?? "?"}`, 67 + ); 62 68 } 63 69 console.log(`Enrichment complete for ${enriched.length} servers`); 64 70 }