-
Notifications
You must be signed in to change notification settings - Fork 41
🐛 Fix screenshot upload failure and overlapping info tooltips #4134
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,10 +194,13 @@ func NewServer(cfg Config) (*Server, error) { | |
| middleware.InitTokenRevocation(db) | ||
|
|
||
| // Create Fiber app | ||
| // feedbackBodyLimit allows base64-encoded screenshot uploads (up to ~20 MB) | ||
| const feedbackBodyLimit = 20 * 1024 * 1024 | ||
| app := fiber.New(fiber.Config{ | ||
| ErrorHandler: customErrorHandler, | ||
| ReadBufferSize: 16384, | ||
| WriteBufferSize: 16384, | ||
| BodyLimit: feedbackBodyLimit, | ||
|
Comment on lines
+197
to
+203
|
||
| ReadTimeout: 30 * time.Second, | ||
| WriteTimeout: 5 * time.Minute, // large static assets on slow networks | ||
| IdleTimeout: 2 * time.Minute, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,10 +300,10 @@ export function useFeatureRequests(currentUserId?: string) { | |
| setIsRefreshing(false) | ||
| }, [loadRequests]) | ||
|
|
||
| const createRequest = useCallback(async (input: CreateFeatureRequestInput) => { | ||
| const createRequest = useCallback(async (input: CreateFeatureRequestInput, options?: { timeout?: number }) => { | ||
| try { | ||
| setIsSubmitting(true) | ||
| const { data } = await api.post<FeatureRequest>('/api/feedback/requests', input) | ||
| const { data } = await api.post<FeatureRequest>('/api/feedback/requests', input, options) | ||
|
Comment on lines
+303
to
+306
|
||
| setRequests(prev => [data, ...prev]) | ||
| return data | ||
| } finally { | ||
|
|
||
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.
Creating a new
http.Clienthere bypasses any custom configuration onh.httpClient(custom Transport, proxies, tracing, keep-alive tuning) and makes timeout behavior inconsistent across GitHub calls. Prefer keeping a single configured client and using a per-request timeout viacontext.WithTimeout(andreq = req.WithContext(ctx)/http.NewRequestWithContext), or if a separate client is required, initialize it once (e.g., on the handler struct) reusing the same Transport ash.httpClientand only changing the timeout.