File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 3030use OCP \IUserSession ;
3131use OCP \Share \Exceptions \ShareNotFound ;
3232use OCP \Share \IManager as ShareManager ;
33+ use Psr \Log \LoggerInterface ;
3334use ReflectionException ;
3435
3536class SessionMiddleware extends Middleware {
@@ -43,6 +44,7 @@ public function __construct(
4344 private IRootFolder $ rootFolder ,
4445 private ShareManager $ shareManager ,
4546 private IL10N $ l10n ,
47+ private LoggerInterface $ logger ,
4648 ) {
4749 }
4850
@@ -99,11 +101,15 @@ private function assertDocumentSession(ISessionAwareController $controller): voi
99101
100102 $ session = $ this ->sessionService ->getValidSession ($ documentId , $ sessionId , $ token );
101103 if (!$ session ) {
104+ // We spotted occurrences of this in combination with out-of-sync situations, so let's log it for now.
105+ $ this ->logger ->error ('Could not find document session for document id ' . $ documentId . ' and session id ' . $ sessionId );
102106 throw new InvalidSessionException ();
103107 }
104108
105109 $ document = $ this ->documentService ->getDocument ($ documentId );
106110 if (!$ document ) {
111+ // We spotted occurrences of this in combination with out-of-sync situations, so let's log it for now.
112+ $ this ->logger ->error ('Could not find document for documentId ' . $ documentId );
107113 throw new InvalidSessionException ();
108114 }
109115
You can’t perform that action at this time.
0 commit comments