@bobfrankston/rmfmail 1.1.30 → 1.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10151,14 +10151,16 @@ async function syncGoogleContactsForAccount(db2, accountId, tokenProvider2) {
10151
10151
  else params.set("requestSyncToken", "true");
10152
10152
  const url = `https://people.googleapis.com/v1/people/me/connections?${params}`;
10153
10153
  const res = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
10154
- if (res.status === 410) {
10155
- setContactsSyncToken(accountId, null);
10156
- syncToken = "";
10157
- nextPageToken = void 0;
10158
- continue;
10159
- }
10160
10154
  if (!res.ok) {
10161
10155
  const err = await res.text().catch(() => "");
10156
+ if (syncToken && (res.status === 410 || /EXPIRED_SYNC_TOKEN|sync token is expired/i.test(err))) {
10157
+ console.log(`[contacts] ${accountId}: sync token expired \u2014 clearing for full resync`);
10158
+ setContactsSyncToken(accountId, null);
10159
+ syncToken = "";
10160
+ nextPageToken = void 0;
10161
+ changed = 0;
10162
+ continue;
10163
+ }
10162
10164
  console.error(`[contacts] API error for ${accountId}: ${res.status} ${err}`);
10163
10165
  return changed;
10164
10166
  }