Skip to content

Prevent screenshot API drift with extension-owned Friends adapters - #261

Merged
Cattn merged 2 commits into
mainfrom
fix/screenshot-api-mock-drift
Nov 9, 2026
Merged

Cattn merged 2 commits into
mainfrom
fix/screenshot-api-mock-drift

Conversation

@Cattn

@Cattn Cattn commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Friends screenshots failed after v6.5.0 because the released screenshot adapter expected the old API. Keep API response adapters beside extension API changes while the website supplies sample data and capture definitions.

Derive batch schedules from existing per-friend samples and add the shared-groups default in scripts/screenshot-data.js. Explicit response overrides retain priority, including empty and null responses. Missing friend samples and unknown requests remain unmocked failures.

Extend src/lib/api/api.test.ts with focused regression coverage that calls actual extension API methods through the real screenshot mocks, without the website's temporary batch/shared-group overrides. Exercise Friends reads, batch schedule response shapes, requested-friend filtering, explicit overrides, and strict rejection. Failures name scripts/screenshot-data.js as the maintenance location. This covers exercised API paths; it does not automatically cover every future feature, component loading behavior, or website selector.

No workflow changes: .github/workflows/ui.yml matches its pre-PR content. No new test files, code comments, logging removals, website changes, or merges. Documentation explains ownership, manual website validation, and migration.

Validation:

  • 127 unit tests passed across 14 existing files (excluding the local website checkout's unrelated tests); the API file also passed independently after the final edit.
  • Replacing the adapter temporarily with its pre-fix version made the regression fail with the scripts/screenshot-data.js maintenance reminder; restored the fixed file afterward.
  • svelte-check: zero errors/warnings. Changed-file ESLint, Prettier, and git diff --check passed.
  • Earlier validation of the unchanged adapter: build-dev, 52 deterministic UI tests, UI TypeScript, and all 35 actual website scenarios passed, both with current website fixtures and with temporary overrides removed locally (website ed074351).

History informing the implementation:

Website follow-up after a release containing this adapter: remove the temporary POST /api/friends/processed_events and empty GET /api/friends/shared_groups overrides from scripts/screenshotConfig/calendar.json; retain per-friend samples. Existing overrides remain compatible and intentionally bypass derivation until removed.

@Cattn
Cattn marked this pull request as ready for review November 9, 2026 03:54
@Cattn
Cattn enabled auto-merge November 9, 2026 03:58
@Cattn
Cattn requested a review from miretskydatwit November 9, 2026 03:58

@miretskydatwit miretskydatwit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Cattn
Cattn added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 2d6546a Nov 9, 2026
4 checks passed
@miretskydatwit
miretskydatwit deleted the fix/screenshot-api-mock-drift branch November 9, 2026 04:02
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.

2 participants