Privacy
-------

Add note to informed consent, that background sounds are recorded as well.
Please subjects to  avoid including uninvolved persons.

Right to be forgotten:
The project administrators are responsible to cleanup personal data (WikiSpeech projects, but at least the subject accounts) 
But we also need a procedure to delete the accounts after some time, when a project is completed.


Lost Update problems
--------------------

The REST API is currently not protected against the lost update problem.

Discussion:
REST only provides optimistic locking, but in our case it maybe better to lock entities in some cases.

Examples:
- Starting SpeechRecorder session.
- Typical checkout of recording item for annotation (in WikiSpeech the annoattion is only a selection of audio segemnt).

It would be better to notify a user if the session/recording item is edited by another user.



Resubmissions
-------------------

Back-button and Reload Resubmissions:

(Solve preferentially by POST/redirect/GET pattern)

Affected actions:


Reload Resubmissions:

(Can they be solved by POST/redirect/GET pattern as well?)

Delete session: Forwards to sessions list -> Reload NoSuch ... Exception


How to delete a subject account and his speaker entity?



2.0.0-SNAPSHOT
--------------

Some recordings fail some not:


For example local Tomcat:
http://localhost:8080/wikispeech/prjdb/script/RecordingView.jsp?_cmd=view&recpromptId=405   -> OK

http://localhost:8080/wikispeech/prjdb/script/RecordingView.jsp?_cmd=view&recpromptId=527   -> Error

This is caused by a call to size() on an IndirectSet.


Compare with v1-x-x version: REmove @Cachable annotation on Prompitem entity class: OK. Works again.

But now listing of sessions is slow again. Maybe caused by a project with a very long script. TODO.


Regressions:
------------
-New speaker by invitation gets new speaker button!  FIXED (missing em.merge)

-Project admin db accounts does not show account of invited speaker. FIXED (see above)

-Restart speechrecorder with existing session. Already recorded files:
Recording file could not be loaded: EncodingError: MediaDecodeAudioDataUnknownContentType
Request e.g.
https://webapp4.phonetik.uni-muenchen.de/wikispeech/api/v1/project/Test1/session/101300555/recfile/vet_C2_01/0
Receives JSON recording file info instead of audio file!
FIXED (Accept:audio/wav header now required to get the audio file instead of recording file descriptor)

-Sessions too slow! Problem is project with very long (many recordings) scripts. FIXED: Cache to application scope variable

2.1.0-SNAPSHOT
--------------

On webapp4 on deletion of recording file recordingFileId=101300930&_delete=Löschen
Fehler: Internal Exception: org.postgresql.util.PSQLException: FEHLER: Spalte t1.annotation_id existiert nicht Hinweis: Vielleicht wurde beabsichtigt, auf die Spalte »t0.annotation_id« zu verweisen. Position: 8 Error Code: 0 Call: SELECT t1.annotation_id, t1.anno_begin, t1.anno_end, t1.anno_text, t1.anno_type, t1.annotator, t1.COMMENT, t1.PRIORITY, t1.project, t1.prompt, t1.quality, t1.segment_begin, t1.segment_end, t1.signal_url, t1.status FROM annotates t0, annotation t1 WHERE ((t0.recording_id = ?) AND (t1.annotation_id = t0.annotation_id)) bind => [101300930] Query: ReadAllQuery(name="annotations" referenceClass=Annotation sql="SELECT t1.annotation_id, t1.anno_begin, t1.anno_end, t1.anno_text, t1.anno_type, t1.annotator, t1.COMMENT, t1.PRIORITY, t1.project, t1.prompt, t1.quality, t1.segment_begin, t1.segment_end, t1.signal_url, t1.status FROM annotates t0, annotation t1 WHERE ((t0.recording_id = ?) AND (t1.annotation_id = t0.annotation_id))")

Bugs:
-----

WSP-0033 2020-04-19
"Project admin deleting user account gets permission denied exception."


Minor problems:
---------------

EclipseLink Warnings in catalina.out:

[EL Warning]: 2020-04-19 21:36:59.226--ServerSession(1982734693)--Parent Entity Recordingscript has an isolation level of: PROTECTED which is more protective then the subclass S
cript with isolation: null so the subclass has been set to the isolation level PROTECTED.

See: https://stackoverflow.com/questions/10824508/cache-isolation-level-warning-on-parent-entity


[EL Warning]: 2020-04-19 21:36:59.173--ServerSession(1982734693)--Reverting the lazy setting on the OneToOne or ManyToOne attribute [promptDoc] for the entity class [class ipsk.
db.speech.script.prompt.Mediaitem] since weaving was not enabled or did not occur.

https://www.eclipse.org/eclipselink/documentation/2.5/concepts/app_dev007.htm

We do not use weaving, so some the lazy loading of some relationships cannot be satisfied. Should we remove this directives? 



SessionController.deleteSessionWithRecordingFileDirectory() should check security token.
