From 4304ffba767ff397119a40209fd11f149af454d4 Mon Sep 17 00:00:00 2001 From: Jorel97 <83238249+Jorel97@users.noreply.github.com> Date: Fri, 29 May 2026 12:51:14 -0600 Subject: [PATCH 1/2] fix(dns): narrow Google DNS record deletion inputs --- packages/dns/googledns/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/dns/googledns/src/index.ts b/packages/dns/googledns/src/index.ts index dbb4c535..b8343ed2 100644 --- a/packages/dns/googledns/src/index.ts +++ b/packages/dns/googledns/src/index.ts @@ -124,13 +124,18 @@ export default defineDns({ const project = config.projectId ?? _secret('GOOGLE_PROJECT_ID'); if (!project) throw new Error('GOOGLE_PROJECT_ID not set'); const [type, name] = recordId.split('/'); + if (!type || !name) { + throw new Error('Google Cloud DNS deleteRecord: invalid record id'); + } // Need to fetch the rrset to get current rrdatas for the deletion entry. const existing = (await this.listRecords(zoneId, config)).filter( r => r.type === type && (r.name === name || r.name === name.replace(/\.$/, '')), ); if (existing.length === 0) return; const fqdn = name.endsWith('.') ? name : `${name}.`; - const ttl = existing[0].ttl; + const first = existing[0]; + if (!first) return; + const ttl = first.ttl; const res = await fetch(`${API}/projects/${project}/managedZones/${zoneId}/changes`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, From d0c88b9b4183c42234a3733d5714a6eb75a1b5e9 Mon Sep 17 00:00:00 2001 From: Jorel97 <83238249+Jorel97@users.noreply.github.com> Date: Fri, 29 May 2026 12:55:37 -0600 Subject: [PATCH 2/2] fix(dns): throw on unavailable Google DNS record --- packages/dns/googledns/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/dns/googledns/src/index.ts b/packages/dns/googledns/src/index.ts index b8343ed2..2c156fd2 100644 --- a/packages/dns/googledns/src/index.ts +++ b/packages/dns/googledns/src/index.ts @@ -134,7 +134,9 @@ export default defineDns({ if (existing.length === 0) return; const fqdn = name.endsWith('.') ? name : `${name}.`; const first = existing[0]; - if (!first) return; + if (!first) { + throw new Error('Google Cloud DNS deleteRecord: matching record unavailable'); + } const ttl = first.ttl; const res = await fetch(`${API}/projects/${project}/managedZones/${zoneId}/changes`, { method: 'POST',