Compare commits

...

2 Commits

Author SHA1 Message Date
Peter Steinberger
ba871197cd fix(calendar): hide cancelled events in list output (#362) (thanks @sharukh010)
Some checks failed
ci / test (push) Has been cancelled
ci / worker (push) Has been cancelled
ci / windows (push) Has been cancelled
ci / darwin-cgo-build (push) Has been cancelled
2026-03-07 16:52:31 +00:00
=
061ffbe89d fix: filter cancelled events from calendar list by default 2026-03-07 16:50:54 +00:00
4 changed files with 43 additions and 1 deletions

View File

@ -17,6 +17,7 @@
- Google API: use transport-level response-header timeouts for API clients while keeping token exchanges bounded, so large downloads are not cut short by `http.Client.Timeout`. (#425) — thanks @laihenyi.
- Auth: keep Keep-only service-account fallback isolated to Keep commands so other Google services do not accidentally pick it up. (#414) — thanks @jgwesterlund.
- Contacts: send the required `copyMask` when deleting "other contacts", avoiding People API 400 errors. (#384) — thanks @rbansal42.
- Calendar: hide cancelled/deleted events from `calendar events` list output by explicitly setting `showDeleted=false`. (#362) — thanks @sharukh010.
- Gmail: add a fetch delay in `watch serve` so History API reads don't race message indexing. (#397) — thanks @salmonumbrella.
- Gmail: allow Workspace-managed send-as aliases with empty verification status in `send` and `drafts create`. (#407) — thanks @salmonumbrella.
- Gmail: preserve the selected `--client` during `watch serve` push handling instead of falling back to the default client. (#411) — thanks @chrysb.

View File

@ -20,6 +20,7 @@ func calendarEventsListCall(ctx context.Context, svc *calendar.Service, calendar
MaxResults(maxResults).
SingleEvents(true).
OrderBy("startTime").
ShowDeleted(false).
Context(ctx)
if strings.TrimSpace(pageToken) != "" {
call = call.PageToken(pageToken)

View File

@ -0,0 +1,40 @@
package cmd
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"
)
func TestCalendarEventsListCall_HidesCancelledEvents(t *testing.T) {
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if got := r.URL.Query().Get("showDeleted"); got != "false" {
t.Fatalf("expected showDeleted=false, got %q", got)
}
if got := r.URL.Query().Get("singleEvents"); got != "true" {
t.Fatalf("expected singleEvents=true, got %q", got)
}
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(map[string]any{"items": []any{}})
}))
defer srv.Close()
svc, err := calendar.NewService(context.Background(),
option.WithHTTPClient(srv.Client()),
option.WithEndpoint(srv.URL+"/"),
option.WithoutAuthentication(),
)
if err != nil {
t.Fatalf("NewService: %v", err)
}
if _, err := calendarEventsListCall(context.Background(), svc, "primary", "2026-01-01T00:00:00Z", "2026-01-02T00:00:00Z", 10, "", "", "", "", "").Do(); err != nil {
t.Fatalf("Do: %v", err)
}
}

View File

@ -287,7 +287,7 @@ func parseBraceKeyValue(key, val string, expr *braceExpr) error {
case "y", "yes", boolTrue, "1":
t := true
expr.Check = &t
case "n", "no", "false", "0":
case "n", "no", boolFalse, "0":
f := false
expr.Check = &f
}