Skip to content

perf: After file has been deleted, only update task blocks if deleted file contained any tasks #946

Open
@claremacrae

Description

This was discovered whilst investigating #697.

Situation

As of Tasks 1.11.0, when a file is deleted, Cache.ts:

  • deletes all tasks from the named file
  • forces all active tasks code blocks to be refreshed

The code - see line 148:

https://github.com/obsidian-tasks-group/obsidian-tasks/blob/ce5277ac00e231e6ea34bbe1de30ea9335e5c7b8/src/Cache.ts#L136:L152

Recommendation

An optimisation would be to do the this.notifySubscribers(); call if the number of tasks was changed.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions