You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: correct typo in property name resopnseTimeMs → responseTimeMsfix: correct typo in property name resopnseTimeMs → responseTimeMs (#2954)
# Fix: Correct typo in property name `resopnseTimeMs` → `responseTimeMs`
## Summary of Changes
This PR fixes a widespread typo in the codebase where the property name
`resopnseTimeMs` (misspelled) was used instead of the correct
`responseTimeMs` throughout the request handling system.
## Type of Change
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] Code quality improvement
## The Problem
The property `resopnseTimeMs` in the `GraphQLResponseData` interface and
its implementations contained a typo - "resopnse" instead of "response".
This typo was propagated across:
- **Type definition**: `GraphQLResponseData` interface in `types.ts`
- **Implementation files**: 4 request handler files (`http.ts`,
`action-cable.ts`, `utils.ts`) and 1 service file (`gql.service.ts`)
- **Test files**: 3 test specification files with 25 test expectations
- **Total occurrences**: 30 instances across 9 files
While this typo didn't cause functional issues (the property worked as
intended), it affects:
- Code readability and professionalism
- Maintainability
- Potential confusion for contributors
## The Solution
The fix systematically renames all occurrences of `resopnseTimeMs` to
the correctly spelled `responseTimeMs`:
### Files Modified
**Core Package (`altair-core`):**
- `src/request/types.ts` - Type definition
- `src/request/utils.ts` - Response observer implementation
- `src/request/handlers/http.ts` - HTTP request handler
- `src/request/handlers/action-cable.ts` - Action Cable handler
- `src/request/adapters.spec.ts` - Adapter tests (4 occurrences)
- `src/request/handlers/http.spec.ts` - HTTP handler tests (16
occurrences)
**App Package (`altair-app`):**
- `src/app/modules/altair/services/gql/gql.service.ts` - GQL service
- `src/app/modules/altair/services/gql/gql.service.spec.ts` - GQL
service tests (5 occurrences)
### Changes Summary
- 8 files changed
- 30 insertions(+)
- 30 deletions(-)
## Testing
All existing tests have been updated to use the corrected property name.
The fix is purely a rename operation with no logic changes, so:
- ✅ All existing test cases continue to validate the same functionality
- ✅ Type checking passes with the updated interface
- ✅ No breaking changes to the API (internal property only)
### Verification Commands
```bash
# Verify no instances of the typo remain
grep -r "resopnseTimeMs" packages/altair-core packages/altair-app --include="*.ts"
# Should return 0 results
# Verify correct spelling is used
grep -r "responseTimeMs" packages/altair-core packages/altair-app --include="*.ts"
# Should return 30 results
# Run tests
cd packages/altair-core && pnpm test
cd packages/altair-app && pnpm test
```
## Additional Notes
This is a simple typo fix that improves code quality without any
functional changes. The property is internal to the response handling
system and not exposed in the public API, so there are no breaking
changes for users of the library.Fixed widespread typo where
'resopnseTimeMs' was misspelled throughout the codebase. The correct
spelling 'responseTimeMs' is now used consistently across all type
definitions, implementations, and tests.
Changes:
- Updated GraphQLResponseData interface in types.ts
- Fixed property assignments in request handlers (http, action-cable,
utils)
- Updated gql.service.ts property access
- Corrected all test expectations (30 total occurrences across 9 files)
This is a code quality improvement with no functional changes.
### Fixes #
<!-- Mention the issues this PR addresses -->
### Checks
- [ ] Ran `yarn test-build`
- [ ] Updated relevant documentations
- [ ] Updated matching config options in altair-static
### Changes proposed in this pull request:
<!-- Describe the changes being introduced in this PR -->
## Summary by Sourcery
Correct the misspelled response time property across request handling
and related services to use a consistently named responseTimeMs field.
Bug Fixes:
- Fix inconsistent response timing field name by renaming resopnseTimeMs
to responseTimeMs in request handlers and related services.
Enhancements:
- Improve code readability and maintainability by standardizing the
GraphQL response timing property name in core types and utilities.
Tests:
- Update HTTP handler, adapter, and GqlService tests to assert the
corrected responseTimeMs property name.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Corrected a property name in GraphQL response data returned by request
handlers and adapters, ensuring consistent and accurate response
metadata across all request types.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Samuel <samuelimolo4real@gmail.com>
0 commit comments