facerecognition
facerecognition copied to clipboard
Cancel in-flight requests for face images when "I am not sure" is clicked
Steps to reproduce
- Open the "There are more persons to recognize" view
- Open your browser console to the network tab and clear all logged requests
- Click the "I am not sure" button and notice how a bunch of HTTP requests get populated in the developer console
- Click "I am not sure" again, notice a bunch more HTTP requests get populated, then wait for all the HTTP requests to "settle"
Expected behaviour
The app should cancel in-flight requests from the previous screen.
Actual behaviour
Every request is serviced roughly in order, and this means that the new screen has to wait for the images from the previous screen to load, even though those images will no longer be displayed to the user. In other words: it's a head-of-line blocking problem.
Server configuration
(Omitting irrelevant information since this is a purely client-side problem.)
-
Web server: Apache 2
-
Database: MySQL
-
Nextcloud version: 20
Client configuration
-
Browser: Firefox Nightly 84
-
Operating system: Debian 10 Linux
Logs
N/A (note: I'm omitting the network log because the interesting part of the network log here isn't the requests themselves, it's the timing, and I don't really know how to get something out of the browser that will convey that well; I also looked through the JS console and there's nothing interesting there)
I can reproduce this by looking at the webserver logs as well. It also happens when closing the window using the [x]. I am using firefox as well, maybe it is a browser issue that it keeps loading images even though they've disappeared?
EDIT: also happens on chromium
Hi @strugee @Derkades Sincerely I noticed it :disappointed: , but ignored it because I only found it annoying the first time I added most of the names .. :disappointed:
I'm not a javascript/html expert, far from it. The dialog uses the image tag directly and although the image is destroyed, it seems that the request is not cancelled. Maybe I should use lozad, like the rest of the images of the application. Tomorrow a PR for it .. I will ask for your help to test it. :smiley: