Forget pushed event ids when Google Calendar is disconnected (Feature 16)
Disconnect deleted the connection but left every pushed plan synced with its stored event ids, though no calendar was chosen any more. It now deletes the connection and runs the same invalidation as choosing another calendar (forgetEvents: MarkCalendarPlansEdited, ClearCalendarEvents) in one transaction, under the account lock. A refused revoke still changes nothing. Tests push three weeks, disconnect, and check each is changed with no event id; then connect again, choose a calendar and push the whole week to it. Also: a refused revoke keeps every week synced, and a disconnect during a push waits for its record and then forgets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -273,9 +273,9 @@ WHERE EXISTS (
|
||||
`
|
||||
|
||||
// Records that Calendar no longer shows the days with a calendar event id
|
||||
// as planned, since another calendar is chosen: every plan with such a day
|
||||
// is edited as MarkWeekPlanEdited does, so a synced plan becomes changed
|
||||
// and a push that read it before is refused.
|
||||
// as planned, since another calendar or none is chosen: every plan with
|
||||
// such a day is edited as MarkWeekPlanEdited does, so a synced plan becomes
|
||||
// changed and a push that read it before is refused.
|
||||
func (q *Queries) MarkCalendarPlansEdited(ctx context.Context, updatedAt string) error {
|
||||
_, err := q.db.ExecContext(ctx, markCalendarPlansEdited, updatedAt)
|
||||
return err
|
||||
|
||||
@@ -173,9 +173,9 @@ type Querier interface {
|
||||
// first.
|
||||
ListWeekPlanDinnerIDs(ctx context.Context, weekStart string) ([]sql.NullString, error)
|
||||
// Records that Calendar no longer shows the days with a calendar event id
|
||||
// as planned, since another calendar is chosen: every plan with such a day
|
||||
// is edited as MarkWeekPlanEdited does, so a synced plan becomes changed
|
||||
// and a push that read it before is refused.
|
||||
// as planned, since another calendar or none is chosen: every plan with
|
||||
// such a day is edited as MarkWeekPlanEdited does, so a synced plan becomes
|
||||
// changed and a push that read it before is refused.
|
||||
MarkCalendarPlansEdited(ctx context.Context, updatedAt string) error
|
||||
// Moves a dinner still in the Quest log to tried; a dinner with any other
|
||||
// status is left as it is (0 rows).
|
||||
|
||||
Reference in New Issue
Block a user