Server receives request and processes it but Retrofit Android timesouts and fails because of bad internet

huangapple 未分类评论52阅读模式
英文:

Server receives request and processes it but Retrofit Android timesouts and fails because of bad internet

问题

我意识到有时候通过 Retrofit 发出请求时会因为超时而失败,但服务器似乎会记录并插入收集到的数据。这使得处理重试变得非常棘手(在我作为初学者开发者的角度),因为相同的数据可能会被插入两次,或者您可能不得不向用户提供错误的响应,因为即使请求失败但数据实际上已经被提交了。

英文:

I have realized that sometimes when I make a request through Retrofit it fails because of timeout but the server seems to log and insert the data collected. It makes handling retry's very tough (in my perspective as a novice developer) since the same data could be inserted twice or you might have to give the user wrong responses because if failed even though it went through.

huangapple
  • 本文由 发表于 2020年4月9日 21:56:10
  • 转载请务必保留本文链接:https://java.coder-hub.com/61122822.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定