-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(tools): fixed zendesk tools, kb upload failure for md files, stronger typing #2297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR fixes multiple issues across Zendesk tools, knowledge base uploads, and WordPress integrations, while improving type definitions throughout. Key Changes
Issues Found
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Browser
participant KBUploadHook as Knowledge Upload Hook
participant ValidationUtils as Validation Utils
participant FileUtils as File Utils
participant S3 as S3 Storage
Note over User,S3: MD File Upload Flow (Fixed)
User->>Browser: Select .md file
Browser->>KBUploadHook: File object (empty type)
KBUploadHook->>KBUploadHook: getFileContentType(file)
alt file.type is empty
KBUploadHook->>FileUtils: getFileExtension(filename)
FileUtils-->>KBUploadHook: "md"
KBUploadHook->>FileUtils: getMimeTypeFromExtension("md")
FileUtils-->>KBUploadHook: "text/markdown"
else file.type exists
KBUploadHook->>KBUploadHook: Use file.type
end
KBUploadHook->>ValidationUtils: validateFileType(filename, mimeType)
ValidationUtils->>ValidationUtils: Check if baseMimeType is empty
alt baseMimeType is empty
ValidationUtils-->>KBUploadHook: null (allow)
else baseMimeType exists
ValidationUtils->>ValidationUtils: Validate against allowed types
ValidationUtils-->>KBUploadHook: null or error
end
KBUploadHook->>S3: Upload with derived MIME type
S3-->>KBUploadHook: Success
KBUploadHook-->>User: File uploaded
Note over User,S3: WordPress Upload Flow (New Route)
User->>Browser: Select media file
Browser->>WordPressTool: File via tool
WordPressTool->>APIRoute: POST /api/tools/wordpress/upload
APIRoute->>APIRoute: processSingleFileToUserFile
APIRoute->>APIRoute: downloadFileFromStorage
APIRoute->>APIRoute: getMimeType (extension-based)
APIRoute->>WordPress: FormData with file
WordPress-->>APIRoute: Media object
APIRoute-->>WordPressTool: Success response
WordPressTool-->>User: Media uploaded
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
51 files reviewed, 1 comment
Summary
Type of Change
Testing
tested manually
Checklist