Skip to content

Comments

Fix CI test failures#73

Merged
sergeychernyshev merged 6 commits intomainfrom
72-tests-are-failing-in-ci
Feb 22, 2026
Merged

Fix CI test failures#73
sergeychernyshev merged 6 commits intomainfrom
72-tests-are-failing-in-ci

Conversation

@sergeychernyshev
Copy link
Member

@sergeychernyshev sergeychernyshev commented Feb 22, 2026

This PR resolves the test failures observed in CI and local environments, and refines the admin verification logic.

Changes:

  • Architecture: Removed email-based admin verification. Admins are now verified strictly by their User Durable Object IDs.
  • Local Dev: Migrated local development configuration to wrangler.local.jsonc (ignored by git) and updated .gitignore.
  • Developer Scripts: Updated package.json scripts (dev, start, cf-typegen) to use the new wrangler.local.jsonc configuration file.
  • API Fix: Updated the admin impersonate endpoint to accept both user_id and userId. The tests were sending userId, causing 400 Bad Request errors.
  • Improved isAdmin Robustness: Refactored the isAdmin function to consistently handle various user object structures and removed reliance on emails or provider-specific IDs.
  • System Index Update: Updated SystemDO.listUsers to reflect the new admin verification logic (removing email/provider checks).
  • Test Resilience: Updated wrangler.test.jsonc to use only admin ID in ADMIN_IDS.
  • Refactoring: Cleaned up handleMeImage to use getUserFromSession, removing duplicate session handling logic.
  • Bug Fix: Added an explicit 404 response for unhandled admin /api/ paths. This prevents falling through to static asset fetching, which could cause TypeError when the request body was already consumed.

Closes #72

✨ Assisted by AI: Gemini

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 22, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
startup-api 194232a Feb 22 2026, 07:57 PM

@sergeychernyshev sergeychernyshev force-pushed the 72-tests-are-failing-in-ci branch 2 times, most recently from 8aed873 to ab0f0fb Compare February 22, 2026 19:08
@sergeychernyshev sergeychernyshev force-pushed the 72-tests-are-failing-in-ci branch from ab0f0fb to 0d7932c Compare February 22, 2026 19:12
@sergeychernyshev sergeychernyshev merged commit e9acb42 into main Feb 22, 2026
2 checks passed
@sergeychernyshev sergeychernyshev deleted the 72-tests-are-failing-in-ci branch February 22, 2026 19:57
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.

Tests are failing in CI

1 participant