Skip to content

Instantly share code, notes, and snippets.

@meshin
meshin / deactivate_broken_gmail_integrations.rb
Created May 27, 2026 15:23
Deactivate Gmail integrations with unrecoverable watch errors
# Deactivate Gmail integrations that failed watch renewal due to unrecoverable errors:
# - failedPrecondition: Mail service not enabled
# - PERMISSION_DENIED: Request had insufficient authentication scopes
#
# Set dry_run = false below to execute
dry_run = true
BROKEN_IDS = [
81530, # failedPrecondition: Mail service not enabled
@meshin
meshin / heal_gmail_history_id.rb
Last active May 27, 2026 15:22
Heal Gmail integrations with blank history_id (PR fix/gmail-watch-renewal-alert-48h)
# Heal Gmail integrations stuck with blank history_id
# Source: Bugsnag https://app.bugsnag.com/productive/api/errors/68f25b8bcc7f080b9e1e42b1
#
# Note: record_watch_renewal in production never persisted history_id — this script
# calls watch_inbox (which saves watch_expiration + metric) then manually saves history_id.
#
# Set dry_run = false below to execute
dry_run = true