From 8eada07869b8f769822d7ae109a8cfcb16c5cdfc Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Sun, 20 Sep 2026 16:44:20 +0200 Subject: [PATCH] Drop subject:LiveTrack from the Apps Script's Gmail search, it finds nothing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documented as matching regardless of language, on the assumption Gmail's subject: operator does a substring match — empirically false against a real, currently-arriving LiveTrack email whose subject does contain the word ("Sledujte LiveTrack používateľa ...", confirmed 2026-09-20): with the filter, the search returned zero threads; removing it and rerunning found the email immediately. Left out entirely rather than replaced — from:noreply@garmin.com plus the session-link regex already narrows this down to real LiveTrack emails with something usable in them. --- docs/deployment.adoc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/deployment.adoc b/docs/deployment.adoc index 6d0e30a..9388cb2 100644 --- a/docs/deployment.adoc +++ b/docs/deployment.adoc @@ -212,7 +212,7 @@ const PROCESSED_LABEL = "livetrack-processed"; function checkLiveTrackEmail() { const label = GmailApp.getUserLabelByName(PROCESSED_LABEL) || GmailApp.createLabel(PROCESSED_LABEL); - const threads = GmailApp.search(`from:noreply@garmin.com subject:LiveTrack -label:${PROCESSED_LABEL}`); + const threads = GmailApp.search(`from:noreply@garmin.com -label:${PROCESSED_LABEL}`); threads.forEach(thread => { // getBody() (raw HTML), not getPlainBody(): the email has no text/plain @@ -235,9 +235,14 @@ function checkLiveTrackEmail() { The Gmail label (rather than marking the message read/unread) tracks which threads are already handled without touching the user's own inbox state. -`subject:LiveTrack` matches regardless of the account's language — Garmin -keeps "LiveTrack" as-is in the subject even in a localized -("Sledujte LiveTrack používateľa ...") one. +No `subject:LiveTrack` filter on the search — despite Gmail's own +substring-match documentation for `subject:`, that filter empirically +returned zero threads against a real, currently-arriving LiveTrack email +whose subject does contain the word ("Sledujte LiveTrack používateľa +...", confirmed 2026-09-20), so it's left out entirely — the regex match +below is what actually narrows this down to real LiveTrack emails with a +usable session link, `from:noreply@garmin.com` alone is deliberately +broad. Set the trigger from the editor: clock icon on the left (Triggers) → *Add Trigger* → function `checkLiveTrackEmail`, time-driven, "Minutes timer",