Skip to content

fix(sync): preserve subscriptions from other semesters#8

Merged
tiankaima merged 2 commits into
mainfrom
agent/fix-subscription-history
Jul 15, 2026
Merged

fix(sync): preserve subscriptions from other semesters#8
tiankaima merged 2 commits into
mainfrom
agent/fix-subscription-history

Conversation

@tiankaima

Copy link
Copy Markdown
Member

Root cause

school sync combined all matched sections into one global action=set request. The server historically interpreted that request as replacing every subscribed section, so syncing a subset of semesters could erase historical subscriptions used by Dashboard, Bot schedules, homework history, and iCalendar.

This is the CLI side of Life-USTC/server#431 and depends on the semester-scoped server behavior in Life-USTC/server#434.

Changes

  • Group matched section IDs by Life@USTC semester.
  • Send one action=set request per semester with semesterId populated.
  • Preserve the existing aggregate output and skip empty/unmatched semester updates.
  • Add a unit test that locks the semester-scoped request payload.

Validation

  • gofmt
  • go test ./...

@tiankaima

Copy link
Copy Markdown
Member Author

CI exposed that cli/main generated OpenAPI files were behind the current Server schema. I synced the generated client and updated the two ListUploads call sites for its new optional params argument. go test ./... and a second generation pass are clean locally; waiting for the rerun.

@tiankaima
tiankaima merged commit b9fbab2 into main Jul 15, 2026
2 checks passed
@tiankaima
tiankaima deleted the agent/fix-subscription-history branch July 15, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant