From 3822309657eda6e06250df15e81760c53bb4f8ca Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 27 May 2018 12:50:12 +0100 Subject: [PATCH] All: Auto-delete resources only after 10 days to handle some edge cases --- README.md | 2 +- ReactNativeClient/lib/models/NoteResource.js | 2 +- docs/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc722d0aed..03e6d4ae7e 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ Any kind of file can be attached to a note. In Markdown, links to these files ar On the **desktop application**, images can be attached either by clicking on "Attach file" or by pasting (with Ctrl+V) an image directly in the editor, or by drag and dropping an image. -Resources that are not attached to any note will be automatically deleted after a day or two (see [rationale](https://github.com/laurent22/joplin/issues/154#issuecomment-356582366)). +Resources that are not attached to any note will be automatically deleted after 10 days (see [rationale](https://github.com/laurent22/joplin/issues/154#issuecomment-356582366)). **Important:** Resources larger than 10 MB are not currently supported on mobile. They will crash the application when synchronising so it is recommended not to attach such resources at the moment. The issue is being looked at. diff --git a/ReactNativeClient/lib/models/NoteResource.js b/ReactNativeClient/lib/models/NoteResource.js index 10dfbb955d..7212360890 100644 --- a/ReactNativeClient/lib/models/NoteResource.js +++ b/ReactNativeClient/lib/models/NoteResource.js @@ -49,7 +49,7 @@ class NoteResource extends BaseModel { } static async orphanResources(expiryDelay = null) { - if (expiryDelay === null) expiryDelay = 1000 * 60 * 60 * 24; + if (expiryDelay === null) expiryDelay = 1000 * 60 * 60 * 24 * 10; const cutOffTime = Date.now() - expiryDelay; const output = await this.modelSelectAll(` SELECT resource_id, sum(is_associated) diff --git a/docs/index.html b/docs/index.html index 6e66ea8c62..1554f94618 100644 --- a/docs/index.html +++ b/docs/index.html @@ -411,7 +411,7 @@

Attachments / Resources

Any kind of file can be attached to a note. In Markdown, links to these files are represented as a simple ID to the resource. In the note viewer, these files, if they are images, will be displayed or, if they are other files (PDF, text files, etc.) they will be displayed as links. Clicking on this link will open the file in the default application.

On the desktop application, images can be attached either by clicking on "Attach file" or by pasting (with Ctrl+V) an image directly in the editor, or by drag and dropping an image.

-

Resources that are not attached to any note will be automatically deleted after a day or two (see rationale).

+

Resources that are not attached to any note will be automatically deleted after 10 days (see rationale).

Important: Resources larger than 10 MB are not currently supported on mobile. They will crash the application when synchronising so it is recommended not to attach such resources at the moment. The issue is being looked at.

Notifications

On the desktop and mobile apps, an alarm can be associated with any to-do. It will be triggered at the given time by displaying a notification. How the notification will be displayed depends on the operating system since each has a different way to handle this. Please see below for the requirements for the desktop applications: