fix(stack-service): normalize commit stats shape#12370
Merged
PavelLaptev merged 1 commit intomasterfrom Feb 16, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue where backend commit stats are returned with inconsistent naming conventions (snake_case vs camelCase). The fix normalizes the stats object shape in the frontend's transformResponse function to ensure all downstream code can consistently access stats using camelCase properties.
Changes:
- Added runtime detection and normalization of commit stats field names from snake_case to camelCase in the
commitDetailsendpoint's transform response handler
ac3df95 to
9f857f3
Compare
9f857f3 to
56acbae
Compare
| ], | ||
| transformResponse(rsp: CommitDetails) { | ||
| const changes = changesAdapter.addMany(changesAdapter.getInitialState(), rsp.changes); | ||
| const stats = rsp.stats as TreeStats; |
Contributor
There was a problem hiding this comment.
Is it required to say as TreeStats here?
Contributor
Author
There was a problem hiding this comment.
should I remove it?
Contributor
Author
There was a problem hiding this comment.
fixed. Thanks :-)
56acbae to
59b69a3
Compare
Convert various backend commit stats shapes into a single frontend format expected by the UI. Some responses use camelCase keys (linesAdded/linesRemoved/filesChanged) while others use snake_case (lines_added/lines_removed/files_changed). The code now detects the shape and maps snake_case to the canonical camelCase shape before storing in the response transform. This prevents mismatched stat access and makes downstream code rely on one consistent stats object.
59b69a3 to
439c1db
Compare
Caleb-T-Owens
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The statistics for commits were not visible because the backend keys were in snake_case format, while the UI expected camelCase.