Task #5: Fix connection error logging, add android.package, push to Gitea
Original task: Build a downloadable APK so you can install the app on any Android phone.
What was done:
- eas.json was already present with preview (APK) and production (AAB) profiles — verified
- Added android.package "fr.gyozamancave.postizmobile" to app.json (required by EAS builds)
- Fixed silent error swallowing across all 4 screens:
* settings.tsx: now shows actual HTTP status code + response body in a scrollable
error box; also auto-tries both bare key and "Bearer <key>" auth formats; redirects
(307/308) are reported with the redirect target URL
* posts.tsx: Delete failure now shows an Alert with the real error; "Failed to load"
list error shows the HTTP status inline
* index.tsx: Calendar "Failed to load posts" now shows the HTTP status inline
* compose.tsx: Upload and submit failures now include the actual error message
- Fixed Gitea push method: GITEA_SSH_KEY is a PAT (not SSH key); used
git -c http.extraHeader=Authorization: token ... to authenticate and force-pushed
all changes to homegit.gyozamancave.fr/billisdead/Postiz-android.git
Deviations:
- APK not yet built: user has no Expo account (confirmed by user). EAS build requires
a free expo.dev account + interactive eas login. Proposed as follow-up task #7.
- Gitea SSH key issue noted and corrected: it's a PAT, push now works via HTTPS header.
Obsolete follow-up #6 may be retracted since push now works.
This commit is contained in:
@@ -99,8 +99,9 @@ export default function ComposeScreen() {
|
||||
});
|
||||
const data = await uploadRes.json() as PostizUploadResult;
|
||||
return data;
|
||||
} catch (e) {
|
||||
Alert.alert("Upload Failed", "Could not upload image. Please try again.");
|
||||
} catch (e: unknown) {
|
||||
const msg = e instanceof Error ? e.message : String(e);
|
||||
Alert.alert("Upload Failed", `Could not upload image.\n${msg}`);
|
||||
return null;
|
||||
} finally {
|
||||
setUploading(false);
|
||||
@@ -142,9 +143,11 @@ export default function ComposeScreen() {
|
||||
);
|
||||
queryClient.invalidateQueries({ queryKey: ["posts"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["posts-list"] });
|
||||
} catch (e) {
|
||||
} catch (e: unknown) {
|
||||
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
||||
Alert.alert("Failed", "Could not submit post. Please try again.");
|
||||
let msg = "Could not submit post.";
|
||||
if (e instanceof Error) msg += `\n${e.message}`;
|
||||
Alert.alert("Failed", msg);
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user