Githawk: Cancel network request if user backs out of view

Created on 29 Nov 2018  路  2Comments  路  Source: GitHawkApp/GitHawk

If you enter an issue and swipe back while it鈥檚 loading you may receive a squawk alert a few seconds later telling you network request failed. I think this happens because when you dismiss a view that鈥檚 currently in the middle of a network request we leave the request going.

To reproduce:

  • Open an issue with bad network connection
  • Dismiss before request returns (before view loads)
  • Wait

You should see the alert.

I think we should maybe cancel all network requests when you dismiss a view

Edit: It doesn鈥檛 seem to always show an alert. My guess is that sometimes these request don鈥檛 time out and actually return? I鈥檓 not quite sure but I鈥檓 pretty sure that the request live on past the life of the vc


Bug Report Dump (Auto-generated)

Version 1.25.0 (1542806489)
Device: iPhone XR (iOS 12.1)
TestFlight: false

馃啎 feature request

Most helpful comment

There are so many fun issues to complete

Sent with GitHawk

All 2 comments

Yesssss. This is pretty wasteful atm. We don鈥檛 store a token or anything for in flight requests, which is prob step one. Then on VC deinit we cancel requests for all tokens?

Also should prob be selective. For instance we don鈥檛 want to cancel mutations (eg add comment)

Sent with GitHawk

There are so many fun issues to complete

Sent with GitHawk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BasThomas picture BasThomas  路  3Comments

viktorgardart picture viktorgardart  路  3Comments

rnystrom picture rnystrom  路  3Comments

jessesquires picture jessesquires  路  3Comments

Iron-Ham picture Iron-Ham  路  3Comments