Failed Uploads Fix
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- objective-c
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu trong TripManager.m tại connection:didReceiveResponse: và kiểm tra cách các mã trạng thái của NSHTTPURLResponse được ánh xạ vào kết quả tải lên. So sánh các trạng thái được xử lý với các phản hồi của máy chủ mà ứng dụng sử dụng, sau đó xác minh rằng các lượt tải lên thành công không còn hiển thị thông báo kServerError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Lloyd and I think we figured out the reason why uploads are failing. In TripManager.m there is a switch statement which runs through a bunch of server responses and if it does not receive any of them defaults to a kServerError message which prints "Upload Failed. Try again later." We just need to rewrite the switch statement to cover all scenarios of server responses because uploads are going through but the server is not passing a message back that the switch statement can interpret so it is defaulting to a failed upload.
\- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
// this method is called when the server has determined that it
// has enough information to create the NSURLResponse
NSLog(@"didReceiveResponse: %@", response);
```
NSHTTPURLResponse *httpResponse = nil;
if ( [response isKindOfClass:[NSHTTPURLResponse class]] &&
( httpResponse = (NSHTTPURLResponse*)response ) )
{
BOOL success = NO;
NSString *title = nil;
NSString *message = nil;
switch ( [httpResponse statusCode] )
{
case 200:
case 201:
success = YES;
title = kSuccessTitle;
message = kSaveSuccess;
break;
case 202:
success = YES;
title = kSuccessTitle;
message = kSaveAccepted;
break;
case 500:
default:
title = @"Internal Server Error";
//message = [NSString stringWithFormat:@"%d", [httpResponse statusCode]];
message = kServerError;
}
NSLog(@"%@: %@", title, message);
//
// DEBUG
NSLog(@"+++++++DEBUG didReceiveResponse %@: %@", [response URL],[(NSHTTPURLResponse*)response allHeaderFields]);
if ( success )
{
[note setUploaded:[NSDate date]];
NSError *error;
if (![managedObjectContext save:&error]) {
// Handle the error.
NSLog(@"TripManager setUploaded error %@, %@", error, [error localizedDescription]);
}
[uploadingView loadingComplete:kSuccessTitle delayInterval:.7];
} else {
[uploadingView loadingComplete:kServerError delayInterval:1.5];
}
}
// it can be called multiple times, for example in the case of a
// redirect, so each time we reset the data.
// receivedData is declared as a method instance elsewhere
[receivedDataNoted setLength:0];
```
}
- Ngôn ngữ chính
- Objective-C
- Star
- 16
- Fork
- 25
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodeForPhilly/CyclePhilly-iOS-app
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
You Can Use POD Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Love the App! Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Upload time Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
Tất cả issue của CodeForPhilly/CyclePhilly-iOS-app
Issue tương tự
-
Suzhou subway logo Đang mởIcons Metro Public Transport
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
organicmaps/organicmaps#13617 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
objective-see/LuLu#925 ·
-
macOS下查找brew::ncurse失败 Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
obsproject/obs-studio#13918 ·