Handle Google token failures and report Google Calendar status (Feature 16) (#128)
CI / ci (push) Successful in 4m27s

Co-authored-by: orchestrator-agent <20+orchestrator-agent@code.cubecraftcreations.com>
This commit was merged in pull request #128.
This commit is contained in:
2026-10-08 00:34:47 -04:00
committed by approver_agent
parent 6262489376
commit 2e16ff1d5a
22 changed files with 1158 additions and 153 deletions
+18
View File
@@ -516,6 +516,24 @@ func TestSchemaSingleRowTablesRejectSecondRow(t *testing.T) {
}
}
// TestSchemaGoogleTokenClearedOnlyWithReason: a Google connection may lose
// its refresh token (reconnect required) only with last_sync_error saying
// why.
func TestSchemaGoogleTokenClearedOnlyWithReason(t *testing.T) {
s := migratedStore(t)
row := testRow("integrations_google", 0)
row["refresh_token_ct"] = nil
inRolledBackTx(t, s, func(tx *sql.Tx) {
wantConstraintError(t, insertSchemaRow(tx, "integrations_google", row), "CHECK", "integrations_google without a token or a reason")
})
row["last_sync_error"] = "Google access was revoked or expired — reconnect"
inRolledBackTx(t, s, func(tx *sql.Tx) {
if err := insertSchemaRow(tx, "integrations_google", row); err != nil {
t.Errorf("integrations_google without a token, with a reason: %v", err)
}
})
}
func TestSchemaDeleteParentWithChildrenRefused(t *testing.T) {
cases := []struct{ parent, child, column string }{
{"recipes", "recipe_ingredients", "recipe_id"},