Failed Uploads Fix
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- objective-c
- Ambito
- mobile-dev
Direzione di ricerca
Inizia in TripManager.m, in corrispondenza di connection:didReceiveResponse:, e verifica come i codici di stato di NSHTTPURLResponse vengono associati ai risultati dei caricamenti. Confronta gli stati gestiti con le risposte del server utilizzate dall’app e verifica quindi che i caricamenti riusciti non visualizzino più il messaggio kServerError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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];
```
}
- Lingua principale
- Objective-C
- Stelle
- 16
- Fork
- 25
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CodeForPhilly/CyclePhilly-iOS-app
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
You Can Use POD Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Love the App! Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
-
Upload time Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
Tutte le issue di CodeForPhilly/CyclePhilly-iOS-app
Issue simili
-
Suzhou subway logo ApertaIcons Metro Public Transport
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
organicmaps/organicmaps#13617 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
objective-see/LuLu#925 ·
-
macOS下查找brew::ncurse失败 Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
obsproject/obs-studio#13918 ·