Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Service/LockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
IUserSession $userSession,
IRequest $request,
LoggerInterface $logger,
private IRootFolder $rootFolder,

Check failure on line 72 in lib/Service/LockService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

MissingDependency

lib/Service/LockService.php:72:3: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)
) {
$this->l10n = $l10n;
$this->userManager = $userManager;
Expand Down Expand Up @@ -162,6 +162,7 @@
);
$this->logger->notice('extending existing lock', ['fileLock' => $known]);
$this->locksRequest->update($known);
$this->lockCache[$lockScope->getNode()->getId()] = $known;
$this->injectMetadata($known);
return $known;
}
Expand Down Expand Up @@ -204,6 +205,7 @@
}

$this->locksRequest->delete($known);
$this->lockCache[$lock->getNode()->getId()] = false;
$this->propagateEtag($lock);
$this->injectMetadata($known);
return $known;
Expand Down Expand Up @@ -404,7 +406,7 @@
return null;
}

$userFolder = $this->rootFolder->getUserFolder($user->getUID());

Check failure on line 409 in lib/Service/LockService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

MissingDependency

lib/Service/LockService.php:409:18: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)
$node = $userFolder->getFirstNodeById($nodeId);
if (empty($node)) {
return null;
Expand Down
6 changes: 6 additions & 0 deletions tests/Feature/LockFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ public function setUp(): void {
}
return time();
});

// switch to user2 to clear stale cache
$this->loginAndGetUserFolder(self::TEST_USER2);

$folder = $this->loginAndGetUserFolder(self::TEST_USER1);
$folder->delete('test-file');
$folder->delete('test-file2');
$folder->delete('test-file3');
$folder->delete('etag_test');

\OC_Hook::$thrownExceptions = [];
$this->overwriteService(ITimeFactory::class, $this->timeFactory);
$this->toTheFuture(0);
Expand Down
Loading