Seems HTTP POST Request firing multiple times


#1

Hi ,

I need to save a submission of a form in our application. I am using normal Http post in the provider. Some times same request data is saved twice or thrice or more on the backend database. Can you provide me some insights into this issue. The version of ionic angular is 3.9.2. This is happening very randomly and we don’t have any pattern to reproduce the issue.


#2

Hi,
You need to show some code if you want help. maybe the user is clicking the form button more than one time?


#3

One extremely unintuitive and mysterious cause for this is when you subscribe to the same request multiple times. For example, I stepped onto this rake when adding progress tracking. The solution that I came up with was to add the share operator to the end of a pipeline on the request.


#4

This kind of strange behaviour is not only happening on button click. but there are few other instances where we are sending request to backend on the resume event of the mobile application.