Tinder Pile problem : my current slide card is swipe 2 times with one unique action

Hi everybody !

I’m currently trying to build a tinder like app that permits to swipe different Item that users lists. If both user swipe each other item, then it’s a match.

here is how i built my workflows :

First, I initiate the swipe of the card (With button or drag) :

so the next card will be shown but in the back end there will be process to put the item in the Like or dislike lists of the current user.
It works like that :
1 - Tinder pile item’s swipe left
2 - Reduce the count of number of card left in the pile with -1 (it is not important here because it only helps to know when there is no more card in order to display a special screen)
3 - then there is the change of the current user like/Dislike item list wich add the item in the list

as you can see the next card is already shown but the backend has’nt yet processed.

The 2 first step works fine. But the problem comes at the third part :

Here you can see that the "TinderPile’s current slide is “Jouet2” (Game2) even though we are still in the workflows that aimed to impact on “Jouet1” (Game1)…
And then after this step the card is instantly considered like a Disliked or a liked item because it is not shown anymore by my tinder pile (which has a rule that doesn’t display already liked/disliked item) BUT this item is not in the liked/disliked list of my user ???

So i got two problems here :
1 - I didn’t find the way to process on my data before swapping ? Or to process on my data with the last item’s info at least ?
2 - There is an unsolvable bug that makes my item considered as a liked/disliked item but just for the current instance because in the example i have “Jouet1” in the disliked item list but not for “jouet2” even though it doesn’t display anymore. And when i refresh the page without refreshing data, “Jouet2” is displayed as it should and not considered as a liked or disliked item.

After refresh : Only “Jouet2” is still here and that’s normal.

Thanks for help guys ! =)

Up !

The problem is only when the debug mode is on. When it is off, my data is setting accurately. I’m not sure where it comes from.