Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for canvas files when wildcard (.*) or .canvas extension is used #48

Conversation

husjon
Copy link
Owner

@husjon husjon commented Apr 12, 2024

When using wildcard extensions (.*) or .canvas in the Attachment extensions option, canvas files where not properly checked for size.

This PR checks for the canvas files size to determine if any nodes are added.

Comment from filter:

// Newly created or cleared out canvas files are currently 28bytes or less
// A single node adds at a minumum about 80 bytes,
//   hence any canvas file less than 50 bytes are tagged as candidates for cleanup

Canvas file structure:

New:

{}

Empty (after deleting nodes):

{
	"nodes":[],
	"edges":[]
}

(minified, this is 24 bytes)

Fixes #46

@husjon husjon merged commit a668d5e into main Apr 12, 2024
@husjon husjon deleted the 46-canvas-are-detected-as-empty-and-deleted-if-is-set-in-the-attachment-extensions-option-1 branch April 12, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canvas are detected as empty and deleted if ".*" is set in the attachment extensions option
1 participant