Repository navigation
Fix type mapping and improve error handling across modules - #14
Merged
Merged
Conversation
- FileStorage: handle storage deletion failure gracefully in DeleteFileAsync to prevent silent orphaned files when storage provider errors - FileStorage: add null/empty validation for IFormFile in UploadEndpoint using TypedResults for consistent return types - Generator: fix nullable value types (int?) mapping to `any` in TypeScript by stripping nested global:: prefixes from Roslyn FQNs - Generator: add Dictionary/IDictionary/IReadOnlyDictionary support, mapping to Record<K, V> in TypeScript instead of `any` - Generator: map System.Object to `unknown` instead of `any` - UI: fix chart legend key prop to use composite key for uniqueness
- Add #pragma warning disable CA1031 for the catch-all exception in best-effort storage deletion (required for TreatWarningsAsErrors) - Skip LogFileDeleted when storage deletion fails to avoid misleading operators with both "deleted" and "failed" logs for the same file
The Dto_WithDictionary_MapsToRecord test compilation needs an explicit reference to the assembly containing Dictionary<TKey,TValue>. On some CI environments, the type-forwarding from System.Runtime.dll may not resolve correctly, causing the test to fail.
Roslyn's FullyQualifiedFormat with UseSpecialTypes produces "int?" not "System.Nullable<System.Int32>", so the System.Nullable< check never matched. Add handling for the T? shorthand form before the explicit generic form. Fixes Dto_WithNullableShorthandValueType_MapsToNullUnion test failure on CI.
antosubash
force-pushed
the
claude/improve-code-quality-MKEBQ
branch
2 times, most recently
from
March 27, 2026 21:41
8755f81 to
394185b
Compare
2 of 5 tasks
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.
Summary
This PR addresses several issues across the codebase: improves TypeScript type generation for nullable value types and dictionaries, enhances file storage deletion error handling, adds file upload validation, and fixes a React key warning.
Key Changes
TypeScript Type Generation (
TypeMappingHelpers.cs)int?) by stripping nestedglobal::prefixes that Roslyn adds during compilationDictionary<K, V>,IDictionary<K, V>, andIReadOnlyDictionary<K, V>to TypeScriptRecord<K, V>typeFindTopLevelComma()helper to correctly parse generic type arguments while respecting nested angle bracketsobject/System.Objectto TypeScriptunknowntypeFile Storage Service (
FileStorageService.cs)DeleteFileAsync()to handle storage deletion failures gracefullyLogStorageDeletionFailed()logger method to track orphaned storage dataFile Upload Endpoint (
UploadEndpoint.cs)IFormFileparameter to nullable and added explicit null/empty checkBadRequestwith descriptive message for invalid uploadsChart Component (
chart.tsx)Notable Implementation Details
FindTopLevelComma()method uses a depth counter to track angle bracket nesting, ensuring correct parsing of complex generic types likeDictionary<List<string>, int>