sct / overseerr

Request management and media discovery tool for the Plex ecosystem
https://overseerr.dev
MIT License
3.73k stars 437 forks source link

Duplicate movie request can be made after closing the browser #1445

Closed Magikarplvl4 closed 3 years ago

Magikarplvl4 commented 3 years ago

Description

One of my end users managed to request the same movie twice. The end-user was able to request the same movie after more ten 30 seconds from the initial request (see logs text). image After some digging and poking around and chatting on the discord support channel I found a way to reproduce the situation. You need to close your browser directly after you hit the second "request" button in the popup. To reproduce it on your own, you need a couple of tries before you will succeed. It imported to have the option "Continue where you left off " enabled in the Chrome browser. (My guess: Google chrome hits his own local cache at that state and shows the request button again on the detail page.)

Version

1.22.0

Steps to Reproduce

Please tell us how we can reproduce the undesired behavior.

  1. Enable Continue where you left off in google chrome
  2. Enable Auto-approve in Overseerr
  3. Search for a movie that you want to request
  4. Click on the movie
  5. On the detail page, click request
  6. Click on the popup again on the request button
  7. Close your browser as fast as you can after hitting the final request button.
  8. Open again the browser
  9. you will see the request button again (and you can hit it to request it the second time)

Please note: I was able to reproduce the problem the first time I tried this scenario out, after that, I need multiple tries before I could reproduce it again for a second time.

Expected Behavior

Maybe a extra mitigation solution in the back-end to filter out duplicate requests?

Screenshots

My first attempt: image

End user: image

Device

What device were you using when you encountered this issue? Please provide this information to help us reproduce and investigate the bug.

Additional Context

Discord talk: https://discord.com/channels/783137440809746482/789002037529804833/832730874730643497

Logs Overseerr

2021-04-15T22:38:29.729Z [info][Notifications]: Sending notification for MEDIA_AUTO_APPROVED 
2021-04-15T22:38:29.731Z [info][Media Request]: Sent request to Radarr 
2021-04-15T22:38:29.912Z [info][Radarr]: Radarr accepted request 
2021-04-15T22:38:29.913Z [debug][Radarr]: Radarr add details {"movie":{"title":"Spy Kids 2: The Island of Lost Dreams","originalTitle":"Spy Kids 2: The Island of Lost Dreams","alternateTitles":[],"secondaryYearSourceId":0,"sortTitle":"spy kids 2 island lost dreams","sizeOnDisk":0,"status":"released","overview":"Exploring the further adventures of Carmen and Juni Cortez, who have now joined the family spy business as Level 2 OSS agents. Their new mission is to save the world from a mad scientist living on a volcanic island populated by an imaginative menagerie of creatures. On this bizarre island, none of the Cortez's gadgets work and they must rely on their wits--and each other--to survive and save the day.","inCinemas":"2002-08-07T00:00:00Z","physicalRelease":"2004-02-11T00:00:00Z","digitalRelease":"2005-12-05T00:00:00Z","images":[{"coverType":"poster","url":"/MediaCover/1480/poster.jpg","remoteUrl":"https://image.tmdb.org/t/p/original/A6gkSQVkbUiSCq7C9kexlJF8GdI.jpg"},{"coverType":"fanart","url":"/MediaCover/1480/fanart.jpg","remoteUrl":"https://image.tmdb.org/t/p/original/5rKa5UKXnTdLsgY0mJbjAEQX3gB.jpg"}],"website":"","year":2002,"hasFile":false,"youTubeTrailerId":"RLkRbj8sv8E","studio":"Dimension Films","path":"/movies/Films 1080P/Spy Kids 2 The Island of Lost Dreams (2002)","qualityProfileId":6,"monitored":true,"minimumAvailability":"preDB","isAvailable":true,"folderName":"/movies/Films 1080P/Spy Kids 2 The Island of Lost Dreams (2002)","runtime":100,"cleanTitle":"spykids2islandlostdreams","imdbId":"tt0287717","tmdbId":9488,"titleSlug":"9488","certification":"PG","genres":["Action","Adventure","Family"],"tags":[],"added":"2021-04-15T22:38:29.8813229Z","addOptions":{"searchForMovie":true,"ignoreEpisodesWithFiles":false,"ignoreEpisodesWithoutFiles":false},"ratings":{"votes":1592,"value":5.6},"collection":{"name":"Spy Kids Collection","tmdbId":86486,"images":[]},"id":1480}}
2021-04-15T22:39:00.030Z [debug][Jobs]: Starting scheduled job: Download Sync 
2021-04-15T22:39:00.035Z [debug][Download Tracker]: Found 1 item(s) in progress on Radarr server: Radarr server 1080P 
2021-04-15T22:39:00.041Z [debug][Download Tracker]: Found 10 item(s) in progress on Sonarr server: Sonarr server 1080P 
2021-04-15T22:39:11.836Z [info][Notifications]: Sending notification for MEDIA_AUTO_APPROVED 
2021-04-15T22:39:11.838Z [info][Media Request]: Sent request to Radarr 
2021-04-15T22:39:11.899Z [info][Radarr]: Movie is already monitored in Radarr. Skipping add and returning success 
2021-04-15T22:40:00.040Z [debug][Jobs]: Starting scheduled job: Download Sync 
2021-04-15T22:40:00.043Z [info][Jobs]: Starting scheduled job: Plex Recently Added Scan 
2021-04-15T22:40:00.043Z [info][Plex Scan]: Scan starting {"sessionId":"27db87a6-c937-4f37-b84d-65207597ae31"}
sct commented 3 years ago

I could have sworn we put in a check for this but I guess it's not... working?

Ill take a look. Thanks for the detailed report 👍

TheCatLady commented 3 years ago

@Magikarplvl4 This should have been fixed in 126d8665ee2808fc0bc37df4ca61f3e63be096e2, which was included in the latest release (v1.25.0). Could you please verify?

TheCatLady commented 3 years ago

Confirmed to have been fixed in 126d8665ee2808fc0bc37df4ca61f3e63be096e2.