Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
85795d6
fix(backend): Reset document session and yjs file when file is deleted
mejo- Mar 13, 2024
8e741de
fix(backend): Reset document session when updated from outside editor
mejo- Mar 13, 2024
8e1ad16
fix(backend): Remove yjs file and all steps when resetting document s…
mejo- Mar 13, 2024
cc2e6c3
fix: catch expected exception in event handler
juliusknorr Mar 15, 2024
aa236cf
fix: Clean up logic to return document state file or file content
juliusknorr Mar 13, 2024
c2798f2
fix: Set base version etag to a unique id per document creation
juliusknorr Mar 13, 2024
ae78252
fix(sync): If `baseVersionEtag` changed, reset frontend
mejo- Mar 15, 2024
f72fb5b
fix(Middleware): Response with 412 if `baseVersionEtag` doesn't match
mejo- Mar 18, 2024
af37fe4
fix(DocumentStatus): Refactor and migrate to `NcNoteCard`
mejo- Mar 18, 2024
25ad80e
test(cypress): Add session API tests with non-matching baseVersionEtag
mejo- Mar 20, 2024
628e463
text(cypress): Test browser refresh warning after document session cl…
mejo- Mar 20, 2024
907d2d4
fix(response): Make sure JSONResponse returns valid data
mejo- Mar 20, 2024
261051c
fix: Create idempotent y.js doc for initial content
juliusknorr Mar 30, 2024
134106f
tests: Add tests for loading documents from different preconditions
juliusknorr Mar 30, 2024
64a6252
fix: Always return initial content when needed
juliusknorr Mar 30, 2024
d464338
tests: Adjust tests covering initial state
juliusknorr Mar 30, 2024
ddabaf0
ci: Make cypress test more stable by closing connections
juliusknorr Mar 31, 2024
499a54f
fix: Adapt to review feedback
juliusknorr Apr 2, 2024
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
Prev Previous commit
Next Next commit
fix: catch expected exception in event handler
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and mejo- committed Apr 2, 2024
commit cc2e6c30c2260116fe34a78b9625404175d04824
7 changes: 6 additions & 1 deletion lib/Listeners/BeforeNodeWrittenListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

namespace OCA\Text\Listeners;

use OCA\Text\Exception\DocumentHasUnsavedChangesException;
use OCA\Text\Service\DocumentService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
Expand All @@ -49,7 +50,11 @@ public function handle(Event $event): void {
if ($node instanceof File && $node->getMimeType() === 'text/markdown') {
if (!$this->documentService->isSaveFromText()) {
// Reset document session to avoid manual conflict resolution if there's no unsaved steps
$this->documentService->resetDocument($node->getId());
try {
$this->documentService->resetDocument($node->getId());
} catch (DocumentHasUnsavedChangesException) {
// Do not throw during event handling in this is expected to happen
}
}
}
}
Expand Down