metabolist/metatext

Switching away from app during slow post causes "the network connection was lost" error

alexbbrown opened this issue · 2 comments

Describe the bug

Sometimes posting takes 30s. See #253.
If I temporarily switch to another app while this happens, I get a "the network connection was lost" error modal.

To Reproduce
Steps to reproduce the behavior:

  1. Click reply on a post
  2. Compose and tap post
  3. If the spinner shows for a few seconds, switch app to eg safari
  4. Return to metatext
  5. Observe "the network connection was lost" modal appears

Expected behavior
if you switch to a different app while metatext is uploading a post or content, then back again, network connection should not be lost

technical note: URLSession supports downloading and uploading while app is in background. That might be a remediation to this issue

Screenshots
If applicable, add screenshots to help explain your problem.

(please complete the following information):

  • Device: iPhone 12
  • OS: iOS 16.1.1
  • App Version: 1.7

Additional context
Add any other context about the problem here.

This can result in multiple posts, since after dismissing the "the network connection was lost", the post form is still presented, but it appears that the post can succeed anyway.

Uploading IMG_0236.png…