Skip to content

fix(mobile): show real PDF import and share failures, clear a stuck time zone error - #209

Open
ayuxy027 wants to merge 3 commits into
CopilotKit:mainfrom
ayuxy027:fix/mobile-native-failures
Open

ayuxy027 wants to merge 3 commits into
CopilotKit:mainfrom
ayuxy027:fix/mobile-native-failures

Conversation

@ayuxy027

@ayuxy027 ayuxy027 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What was broken

Three small things in the iOS and Android app that hid the real failure from the user:

  • Importing a PDF. If the upload failed with a response that isn't JSON (a proxy error page, a gateway timeout, an empty body), the app showed a confusing "Unexpected token" error instead of what actually went wrong.
  • Sharing a PDF. If the download failed (an expired session, a deleted file), the app saved the server's error message as the PDF and opened the share sheet with it, so it looked like it worked.
  • Event time zone. While you type a time zone, the editor shows "Choose a valid time zone." The message stayed there even after the zone was corrected. And if you changed the date or time while the zone was still invalid, that date and time were never converted, and the editor showed the browser's raw "Invalid time zone specified" text instead.

What happens now

  • A failed import shows the server's error, or "Could not import this PDF." This now goes through the same response helper the web upload already uses.
  • A failed share shows the server's error, or "Could not download this PDF.", removes the bad file, and doesn't open the share sheet.
  • As soon as the zone is valid, the message disappears and a date or time entered in the meantime is converted. An unknown zone always shows "Choose a valid time zone."

How I checked

  • Added tests for the native response handling: a normal response, a server error with a message, and an HTML or empty error page.
  • pnpm lint, pnpm typecheck and pnpm test pass.
  • Not tested on a physical iOS or Android device. The time zone fix has no automated test, since the test setup doesn't render components.

Each fix is a separate commit.

On iOS and Android the upload response was parsed as JSON before its status
was checked, so a proxy error page or an empty body showed up as a JSON parse
error. Read it through the same helper the web path uses.
On iOS and Android, sharing a PDF downloaded it without checking the status,
so an expired session or a deleted file saved the server's error as the PDF
and offered it in the share sheet. Show the server's error instead.
The event editor showed 'Choose a valid time zone.' while the zone was being
typed and kept showing it after the zone was corrected. A date or time changed
while the zone was invalid also stayed unconverted, with the raw Intl message.
Once the zone is valid, convert that date and time and clear the message, and
show 'Choose a valid time zone.' for an unknown zone in both places.
@ayuxy027
ayuxy027 force-pushed the fix/mobile-native-failures branch from b242525 to df97566 Compare October 28, 2026 16:05

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant