new BUG-87 - faces with empty locn and no formal connection between file and face? Quick hack added to files as well to at least prevent a 500 server fault, and show it to us if it happens again

This commit is contained in:
2022-04-30 19:38:08 +10:00
parent 4a5bde559d
commit cc478cb722
2 changed files with 26 additions and 2 deletions

18
BUGs
View File

@@ -1,4 +1,20 @@
### Next: 87
### Next: 88
BUG-60: entries per page in flat view will get how_many from each top-level dir in PATH - causes viewer to get lost in eids for last_eid
BUG-85: once we rebuild data from scratch, need to reset just clean out pa_user_state's
BUG-86: had some face locn data be in { } not [ ] again -- I think we need to stop using locn in the DB and instead use a tmp_locn or something else -- no way to touch the DB data then
BUG-87: using Person->show matches->then view an image shows bug in viewer with msising data in json -- that same image via a filename search works...
-- seems some faces have an empty locn, but do have a w and h... (ORM - tmp_locn vs locn???)
# select id, locn, w, h from face where locn is null;
(count shows 500+ at the moment)
interestingly, there is a face for todd in this file:
693, is there more than 1????
HMMM, or when I delete Richard Tan?? (but 500???)
still, the face with no locn also is not connected to any file, SO, why is it a part of the view / select data (is it in the set where we do an AI: search for all AI searches, because its more than todd that fails AI)
OKAY, there is something wrong in the DB on several levels, searched on AI:craig, I get 34211 as a hit, BUT, viewing that file, there is no face at all - feels unlikely, checking DB:
I deleted all faces with no locn, maybe it is a one-off with all the crap I
did with the ORM / tmp_locn.... Will see if it comes back, this stays as a
bug for now

View File

@@ -723,7 +723,15 @@ def view(id):
continue
# put locn data back into array format
for face in e.file_details.faces:
face.locn = json.loads(face.locn)
if face.locn:
face.locn = json.loads(face.locn)
else:
# this at least stops a 500 server error - seems to occur when
# DB contains disconnected faces with no locn data - BUG: 87
face.locn = [ 0,0,0,0 ]
st.SetMessage( f"For some reason this face does not have a locn: face_id={face.id} tell ddp", "warning" )
eids=eids.rstrip(",")
# jic, sometimes we trip this, and rather than show broken pages / destroy