Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Addresses 15 review comments from PR #292 covering security vulnerabilities, documentation inconsistencies, error handling improvements, and missing test coverage.

Security

  • Cache key collision vulnerability: Replaced token suffix (last 8 chars) with SHA-256 hash to prevent cross-user request deduplication
  • Added HTTP method to cache key to prevent GET/POST collisions
// Before: token suffix could collide
const cacheKey = `${token.slice(-8)}:${endpoint}:${JSON.stringify(body || {})}`;

// After: secure hash with method
const tokenHash = createHash('sha256').update(token).digest('hex').slice(0, 16);
const cacheKey = `${method}:${tokenHash}:${endpoint}:${JSON.stringify(body || {})}`;

Circuit Breaker

  • HALF_OPEN state thundering herd: Added halfOpenInFlight counter to limit concurrent test requests (max 2)
  • Error handling: Introduced CircuitBreakerOpenError class, replaced string matching with instanceof checks
// HALF_OPEN now rejects excess concurrent requests
if (this.state === 'HALF_OPEN' && this.halfOpenInFlight >= this.halfOpenMaxRequests) {
  throw new CircuitBreakerOpenError('Circuit breaker is testing recovery');
}

Error Handling

  • Oversized response regression: Created UpstreamResponseTooLargeError class, restored specific 502 error message
  • Circuit breaker detection: Replaced brittle message substring matching with instanceof CircuitBreakerOpenError

Documentation Consistency

  • Rate limiter: Fixed MAX_CONCURRENT references (5 → 3) in code comments and docs
  • Circuit breaker: Updated config docs (3 failures, 60s timeout, 2 test requests)
  • Loading component: Corrected timeout (15s)
  • OpenAPI spec: Version bump (1.4.9 → 1.5.0)
  • EZYGO_VERIFICATION.md: Converted absolute paths to relative

UI/CSS

  • Course card: Fixed invalid wrap-break-wordbreak-words
  • Dropdown menu: Fixed Tailwind arbitrary variants (data-disableddata-[disabled], data-insetdata-[inset])

Health Check

  • Capacity logic: Changed < to <= comparison and incorporated queueLength to avoid false degraded status at full utilization
const atOrBelowCapacity = rateLimiterStats.activeRequests <= rateLimiterStats.maxConcurrent;
const hasBacklog = rateLimiterStats.queueLength > 0;
const isHealthy = !circuitBreakerStatus.isOpen && atOrBelowCapacity && !hasBacklog;

Tests

Added 28 unit tests (13 circuit breaker + 15 rate limiter):

  • All circuit breaker state transitions and HALF_OPEN request limiting
  • Request deduplication, cache key separation (method/token/body), rate limiting enforcement
  • Cache key security verification (tokens with identical suffixes use different hashes)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 8, 2026 11:35
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 8, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/GhostClass/GhostClass/node_modules/.bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Implement EzyGo API batch fetcher with rate limiting Address PR review feedback: security, docs, error handling, tests Feb 8, 2026
Copilot AI requested a review from devakesu February 8, 2026 11:40
@devakesu devakesu marked this pull request as ready for review February 8, 2026 11:44
Copilot AI review requested due to automatic review settings February 8, 2026 11:44
@devakesu devakesu merged commit c274614 into 1.5.0 Feb 8, 2026
@devakesu devakesu deleted the copilot/sub-pr-292 branch February 8, 2026 11:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses prior review feedback for the EzyGo batch fetcher/proxy stack by tightening request-dedup cache keys, improving circuit breaker behavior and error typing, aligning documentation/comments with current limits, and adding unit tests for the new behaviors.

Changes:

  • Harden request deduplication cache keys (token hashing + method separation) and adjust health-check capacity logic.
  • Improve circuit breaker HALF_OPEN behavior (concurrency limiting) and switch to typed errors (CircuitBreakerOpenError, oversized response error).
  • Add Vitest unit tests for rate limiting, deduplication, and circuit breaker state transitions; update docs/UI Tailwind variants.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/ezygo-batch-fetcher.ts Secure cache keying (token hash + method) for deduplication and updated concurrency docs/comments.
src/lib/circuit-breaker.ts Adds typed open error and limits HALF_OPEN concurrent probes to reduce thundering herd.
src/lib/tests/ezygo-batch-fetcher.test.ts New unit tests for deduplication, rate limiting, URL construction, and cache-key security.
src/lib/tests/circuit-breaker.test.ts New unit tests for circuit breaker transitions and HALF_OPEN request limiting.
src/components/ui/dropdown-menu.tsx Fixes Tailwind data-attribute variant syntax for disabled/inset states.
src/components/loading.tsx Corrects timeout value in documentation comment.
src/components/attendance/course-card.tsx Fixes invalid Tailwind class (wrap-break-wordbreak-words).
src/app/api/health/ezygo/route.ts Health logic now considers full utilization and queue backlog.
src/app/api/backend/[...path]/route.ts Improves error typing/handling for circuit-open and oversized upstream responses.
src/app/(protected)/dashboard/page.tsx Updates comment to reflect max concurrency = 3.
public/api-docs/openapi.yaml Bumps OpenAPI version to 1.5.0.
docs/EZYGO_VERIFICATION.md Converts absolute paths to repo-relative references.
docs/EZYGO_RATE_LIMITING.md Aligns docs with MAX_CONCURRENT=3 and updated circuit breaker config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Create secure cache key using SHA-256 hash of token + method + endpoint + body
// This prevents cross-user request deduplication from token suffix collisions
const tokenHash = createHash('sha256').update(token).digest('hex').slice(0, 16);
const cacheKey = `${method}:${tokenHash}:${endpoint}:${JSON.stringify(body || {})}`;
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The cache key uses the raw endpoint string, but the actual request URL is built from a normalized cleanEndpoint (leading slashes removed). This means calls like fetchEzygoData('/myprofile', ...) and fetchEzygoData('myprofile', ...) hit the same upstream URL but will not deduplicate / share rate-limit slots because their cache keys differ. Consider normalizing the endpoint (and any other normalization applied to the URL) before constructing cacheKey so semantically identical requests map to the same key.

Suggested change
const cacheKey = `${method}:${tokenHash}:${endpoint}:${JSON.stringify(body || {})}`;
// Normalize endpoint (e.g., remove leading slashes) so semantically identical endpoints share a cache key
const normalizedEndpoint = endpoint.replace(/^\/+/, '');
const cacheKey = `${method}:${tokenHash}:${normalizedEndpoint}:${JSON.stringify(body || {})}`;

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +60
describe('Request Deduplication', () => {
it('should deduplicate identical in-flight requests', async () => {
const mockResponse = { data: 'test' };
(global.fetch as any).mockResolvedValue({
ok: true,
json: async () => mockResponse,
});

const token = 'test-token';
const endpoint = '/myprofile';

// Make 3 concurrent identical requests
const promises = [
fetchEzygoData(endpoint, token),
fetchEzygoData(endpoint, token),
fetchEzygoData(endpoint, token),
];

const results = await Promise.all(promises);

Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

These tests share module-level state from ezygo-batch-fetcher (LRU cache + the 100ms delayed requestCache.delete). Because some tests reuse the same token/endpoint combination (e.g. /myprofile + test-token here and again in later tests), a previously cached promise can be returned and global.fetch won't be called, making the suite timing-dependent/flaky. Use unique token/endpoint per test, or advance/run timers to flush the 100ms cache eviction, or add a test-only reset hook to clear the cache/queue between tests.

Copilot uses AI. Check for mistakes.
devakesu added a commit that referenced this pull request Feb 11, 2026
* Implement EzyGo API Batch Fetcher with Rate Limiting and Circuit Breaker

- Added EzyGo API Batch Fetcher to optimize concurrent API calls.
- Implemented request deduplication using LRU cache with a 15-second TTL.
- Introduced rate limiting to restrict concurrent requests to a maximum of 3.
- Integrated a circuit breaker pattern to handle API failures gracefully.
- Created health check endpoint to monitor rate limiter and circuit breaker status.
- Developed comprehensive documentation for rate limiting and verification processes.
- Ensured client-side hooks and server-side calls are protected against rate limiting.

* Address PR review feedback: security, docs, error handling, tests (#293)

* Initial plan

* Fix PR review issues: security, docs, error handling, and UI

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Add comprehensive unit tests for circuit breaker and rate limiter

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix cache deduplication, circuit breaker error handling, and test isolation (#294)

* Initial plan

* Fix PR review feedback: cache normalization, TTL behavior, circuit breaker error handling, CSS import, test isolation

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Address code review feedback: fix return type consistency and improve documentation

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Address PR review feedback: add tests, fix error handling, narrow 4xx scope, evict failed promises

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Address code review feedback: refine cache eviction and improve documentation

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Address PR #292 review feedback: hydration, syntax, error handling, docs (#295)

* Initial plan

* Address PR review comments: hydration, syntax, cleanup, docs

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Remove redundant clearTimeout call

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix ldrs CSS import path for Turbopack compatibility

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Update src/app/(protected)/dashboard/DashboardClient.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Co-authored-by: Devanarayanan <fusion@devakesu.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix invalid Tailwind utilities and chart responsiveness (#296)

* Initial plan

* Fix invalid Tailwind utilities and hydration issues

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Refactor ResizeObserver to use consistent updateDimensions function

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Remove redundant nullish coalescing operators

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix trailing whitespace, chart height, and revert problematic hydration

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix invalid Tailwind utilities, add queue limits, handle 429, and prevent cache poisoning (#297)

* Initial plan

* Fix invalid Tailwind utilities across components

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Add queue size limit and timeout to prevent unbounded growth

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Treat 429 status as circuit breaker failure to prevent retry storms

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Update documentation to reflect queue timeout and size limits

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Improve queue error handling with unique IDs and typed errors

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix cache poisoning and preserve 429 rate-limit messages

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Add tests for queue errors and 429 handling

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Improve type safety in logger usage for 429/5xx handling

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix Tailwind syntax, test timeouts, redundant SSR fetch, and cache control (#299)

* Initial plan

* Address review feedback: fix Tailwind syntax, test timeouts, SSR fetch, cache headers, and docs

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Update JSDoc for fetchDashboardData to reflect removal of profile

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix cache poisoning, health check flapping, and initialData handling (#300)

* Initial plan

* Fix review comments: cache eviction, health check, docs, and initialData handling

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix circuit breaker bypass, cache collision, and type safety issues (#301)

* Initial plan

* Fix security, type safety, and circuit breaker issues from code review

- Increased cache key hash from 16 to 64 hex chars (full SHA-256) to prevent cross-user collision
- Moved NEXT_PUBLIC_BACKEND_URL validation outside circuit breaker (now NonBreakerError)
- Made UpstreamResponseTooLargeError extend NonBreakerError to prevent tripping circuit breaker
- Fixed TypeScript type mismatches in useAttendanceReport and useFetchCourses hooks
- Added null type support to query return types and components
- Removed unused isHealthy variable in health check endpoint
- Updated comments to reflect circuit breaker behavior

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix initialData hydration and cache TTL issues from PR #292 review (#302)

* Initial plan

* Fix initialData handling, cache TTL, and chart min-height

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix initialCoursesData null handling, clarify cache TTL docs, add test coverage

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix test setup to match retry configuration

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix documentation/implementation misalignment and incorrect hook type signatures (#303)

* Initial plan

* Align documentation with actual implementation and fix hook type signatures

- Update EZYGO_RATE_LIMITING.md to reflect 60s cache TTL (was 15s)
- Update EZYGO_RATE_LIMITING.md circuit breaker description (60s timeout, 2 test requests)
- Update EZYGO_VERIFICATION.md cache TTL documentation to match actual 60s
- Remove unnecessary `| null` from useFetchCourses return type
- Remove unnecessary `| null` from useAttendanceReport return type
- Fix test mocks to use proper AttendanceReport type structure

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Address PR review feedback: remove "configurable" claim and fix test name

- Remove "(default, configurable)" from cache TTL docs since it's hard-coded
- Rename test from "normalize null initialData" to "fetch data when initialData is undefined" to match actual behavior

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix cache TTL documentation mismatch and body key collision (#304)

* Initial plan

* Fix TTL documentation inconsistencies and cache key generation

- Updated all documentation to reflect 60s TTL instead of 15s
- Fixed cache key generation to properly distinguish undefined from {} body values
- Changed body check from truthy to explicit undefined check for consistency

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Use more unique sentinel value for cache key generation

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Optimize JSON.stringify, add cache key tests, fix doc inconsistencies

- Compute JSON.stringify(body) once and reuse for cache key and fetch body
- Add unit tests for cache key deduplication: undefined vs {} vs null
- Fix EZYGO_VERIFICATION.md line 258: 15s -> 60s TTL
- Clarify EDGE_CASES_TESTS.md: cache stores both in-flight and resolved responses

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix review feedback: Add SECURITY.md, align TTL docs, hash cache keys (#305)

* Initial plan

* Address review comments: Add SECURITY.md, fix TTL docs, hash body in cache key

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Improve cache key comment clarity and fix HttpOnly casing in SECURITY.md

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Forward rate-limit headers from upstream 429 responses (#306)

* Initial plan

* Forward rate-limit headers from upstream 429 responses

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix FIFO queue starvation in EzyGo batch fetcher rate limiter (#312)

* Initial plan

* Fix FIFO queue fairness in waitForSlot function

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Add FIFO fairness regression test for queue management

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix circuit breaker 4xx handling and clarify per-user deduplication scope (#313)

* Initial plan

* Fix circuit breaker 4xx handling and clarify per-user deduplication in docs

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix documentation inconsistencies, add status code tests, clarify comments

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Improve test structure to use consistent error handling pattern

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix documentation mismatches and add Suspense boundary for lazy components (#314)

* Initial plan

* Fix PR review feedback: clarify per-user deduplication and add Suspense boundary

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix circuit breaker threshold and cache key documentation details

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Restrict health endpoint telemetry in production to prevent information disclosure (#315)

* Initial plan

* Restrict detailed telemetry in production health endpoint

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Improve NODE_ENV check to default to secure behavior

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Update documentation for production security restrictions

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Add unit tests and improve code clarity per review feedback

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix rate limiter state corruption and add aria-hidden fallback (#316)

* Initial plan

* Fix timeout cleanup and inert fallback for accessibility

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix generation guard and remove redundant clearTimeout

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Initialize slotGeneration to -1 and improve comment precision

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix AbortError handling, remove ineffective Recharts lazy loading, and add test coverage (#317)

* Initial plan

* Fix abort error handling and remove ineffective Recharts lazy loading

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Add test coverage for timeout/abort path in backend proxy

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix JSDoc, ResizeObserver performance, dev:https validation, and README accuracy (#318)

* Initial plan

* Fix JSDoc, ResizeObserver optimization, dev:https validation, and README accuracy

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix test mock memory leaks, GET request body handling, and Content-Type header semantics (#319)

* Initial plan

* Fix test mocks to respect AbortSignal and GET body parameter handling

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Conditionally set Content-Type header only for POST requests with body

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix header mutation by setting Content-Type before creating fetchOptions

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix backend route timeout test determinism and circuit breaker test isolation (#320)

* Initial plan

* Changes before error encountered

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix test isolation by resetting circuit breaker state before each Rate Limiting test

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Improve timeout test mock robustness with signal validation and early abort handling

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix AbortSignal.timeout() jsdom compatibility and mock isolation in circuit breaker tests (#321)

* Initial plan

* Fix AbortSignal.timeout() compatibility and circuit breaker mock isolation

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix resource leaks in stream reading and timeout signal handling (#322)

* Initial plan

* Fix resource leaks: cancel reader on size limit, clear timeout on fetch completion, improve AbortSignal.timeout detection

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Address review feedback: fix docstring, await reader.cancel(), add timer cleanup tests

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix comment: remove mention of logging that isn't implemented

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix invalid Tailwind CSS class names introduced in v1.5.0 (#323)

* Initial plan

* Fix invalid Tailwind CSS class names

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Remove trailing whitespace from AcceptTermsForm.tsx

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Fix attendance hook tests for initialData support (#324)

* Initial plan

* Fix attendance hook unit tests for initialData support

- Add beforeEach/afterEach hooks to prevent test state pollution
- Disable background refetch settings in test QueryClient
- Increase timeout for error state test to 3000ms
- All 5 attendance tests now passing
- No regressions in other tests (399 tests passing)

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Remove redundant afterEach hook

The beforeEach already clears mocks, so afterEach is unnecessary

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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