···6060 // Use Promise.all to fetch all verification data in parallel
6161 const verificationPromises = trustedUsers.map(async (trustedUser) => {
6262 try {
6363- const response = await fetch(
6464- `https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=${trustedUser}&collection=app.bsky.graph.verification`,
6565- );
6666- const data = await response.json();
6363+ // Helper function to fetch all verification records with pagination
6464+ const fetchAllVerifications = async (user) => {
6565+ let allRecords = [];
6666+ let cursor = null;
6767+ let hasMore = true;
6868+6969+ while (hasMore) {
7070+ const url = cursor
7171+ ? `https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=${user}&collection=app.bsky.graph.verification&cursor=${cursor}`
7272+ : `https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=${user}&collection=app.bsky.graph.verification`;
7373+7474+ const response = await fetch(url);
7575+ const data = await response.json();
7676+7777+ if (data.records && data.records.length > 0) {
7878+ allRecords = [...allRecords, ...data.records];
7979+ }
8080+8181+ if (data.cursor) {
8282+ cursor = data.cursor;
8383+ } else {
8484+ hasMore = false;
8585+ }
8686+ }
8787+8888+ return allRecords;
8989+ };
9090+9191+ // Fetch all verification records for this trusted user
9292+ const records = await fetchAllVerifications(trustedUser);
9393+9494+ console.log(`Received verification data from ${trustedUser}`, {
9595+ records,
9696+ });
67976898 // Check if this trusted user has verified the current profile
6969- if (data.records && data.records.length > 0) {
7070- for (const record of data.records) {
9999+ if (records.length > 0) {
100100+ for (const record of records) {
71101 if (record.value && record.value.subject === profileDid) {
72102 console.log(
73103 `${profileDid} is verified by trusted user ${trustedUser}`,
···7510576106 // Add to verifiers list
77107 profileVerifiers.push(trustedUser);
108108+ break; // Once we find a verification, we can stop checking
78109 }
79110 }
80111 }