Failed Uploads Fix
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- objective-c
- Área
- mobile-dev
Línea de trabajo
Comienza en TripManager.m, en connection:didReceiveResponse:, e inspecciona cómo se asignan los códigos de estado de NSHTTPURLResponse a los resultados de las subidas. Compara los estados gestionados con las respuestas del servidor que utiliza la aplicación y verifica después que las subidas correctas ya no muestren el mensaje kServerError.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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];
```
}
- Lenguaje dominante
- Objective-C
- Estrellas
- 16
- Forks
- 25
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CodeForPhilly/CyclePhilly-iOS-app
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
You Can Use POD Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Love the App! Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
-
Upload time Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
Todos los issues de CodeForPhilly/CyclePhilly-iOS-app
Issues similares
-
Suzhou subway logo AbiertoIcons Metro Public Transport
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
organicmaps/organicmaps#13617 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
objective-see/LuLu#925 ·
-
macOS下查找brew::ncurse失败 Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
obsproject/obs-studio#13918 ·