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 @@ -162,6 +162,7 @@ public function lock(LockContext $lockScope): FileLock {
);
$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 @@ public function unlock(LockContext $lock, bool $force = false): FileLock {
}

$this->locksRequest->delete($known);
$this->lockCache[$lock->getNode()->getId()] = false;
$this->propagateEtag($lock);
$this->injectMetadata($known);
return $known;
Expand Down
6 changes: 6 additions & 0 deletions tests/Feature/LockFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,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