Skip to content

Commit

Permalink
feat(db): Add timestamp field to steps database
Browse files Browse the repository at this point in the history
This should help with debugging document session issues in the future.

Signed-off-by: Jonas <jonas@freesources.org>
  • Loading branch information
mejo- committed Jun 11, 2024
1 parent 576a503 commit 262a275
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- **💾 Open format:** Files are saved as [Markdown](https://en.wikipedia.org/wiki/Markdown), so you can edit them from any other text app too.
- **✊ Strong foundation:** We use [🐈 tiptap](https://tiptap.scrumpy.io) which is based on [🦉 ProseMirror](https://prosemirror.net) – huge thanks to them!
]]></description>
<version>4.0.0</version>
<version>4.1.0</version>
<licence>agpl</licence>
<author mail="jus@bitgrid.net">Julius Härtl</author>
<namespace>Text</namespace>
Expand Down
1 change: 1 addition & 0 deletions composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
'OCA\\Text\\Migration\\Version030501Date20220202101853' => $baseDir . '/../lib/Migration/Version030501Date20220202101853.php',
'OCA\\Text\\Migration\\Version030701Date20230207131313' => $baseDir . '/../lib/Migration/Version030701Date20230207131313.php',
'OCA\\Text\\Migration\\Version030901Date20231114150437' => $baseDir . '/../lib/Migration/Version030901Date20231114150437.php',
'OCA\\Text\\Migration\\Version040100Date20240611165300' => $baseDir . '/../lib/Migration/Version040100Date20240611165300.php',
'OCA\\Text\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
'OCA\\Text\\Service\\ApiService' => $baseDir . '/../lib/Service/ApiService.php',
'OCA\\Text\\Service\\AttachmentService' => $baseDir . '/../lib/Service/AttachmentService.php',
Expand Down
1 change: 1 addition & 0 deletions composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class ComposerStaticInitText
'OCA\\Text\\Migration\\Version030501Date20220202101853' => __DIR__ . '/..' . '/../lib/Migration/Version030501Date20220202101853.php',
'OCA\\Text\\Migration\\Version030701Date20230207131313' => __DIR__ . '/..' . '/../lib/Migration/Version030701Date20230207131313.php',
'OCA\\Text\\Migration\\Version030901Date20231114150437' => __DIR__ . '/..' . '/../lib/Migration/Version030901Date20231114150437.php',
'OCA\\Text\\Migration\\Version040100Date20240611165300' => __DIR__ . '/..' . '/../lib/Migration/Version040100Date20240611165300.php',
'OCA\\Text\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
'OCA\\Text\\Service\\ApiService' => __DIR__ . '/..' . '/../lib/Service/ApiService.php',
'OCA\\Text\\Service\\AttachmentService' => __DIR__ . '/..' . '/../lib/Service/AttachmentService.php',
Expand Down
8 changes: 7 additions & 1 deletion lib/Db/Step.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
* @method setSessionId(int $sessionId): void
* @method getDocumentId(): int
* @method setDocumentId(int $documentId): void
* @method getTimestamp(): int
* @method setTimestamp(int $timestam): void
*/
class Step extends Entity implements JsonSerializable {

Expand All @@ -50,12 +52,15 @@ class Step extends Entity implements JsonSerializable {
protected int $version = 0;
protected int $sessionId = 0;
protected int $documentId = 0;
protected int $timestamp = 0;

public function __construct() {
$this->addType('id', 'integer');
$this->addType('version', 'integer');
$this->addType('documentId', 'integer');
$this->addType('sessionId', 'integer');
$this->addType('timestamp', 'integer');
$this->timestamp = time();
}

public function jsonSerialize(): array {
Expand All @@ -70,7 +75,8 @@ public function jsonSerialize(): array {
'id' => $this->getId(),
'data' => $jsonData,
'version' => $version,
'sessionId' => $this->getSessionId()
'sessionId' => $this->getSessionId(),
'timestamp' => $this->getTimestamp(),
];
}
}

0 comments on commit 262a275

Please sign in to comment.