obsidian-tasks icon indicating copy to clipboard operation
obsidian-tasks copied to clipboard

Render debug logging messages should update file name after file with block in is renamed

Open claremacrae opened this issue 2 years ago • 0 comments

Expected Behavior

When I renamed a file that contains a Tasks block, I expect the future debug log messages associated with that block to show the new file name, via the improved logging messages added in #894.

Current Behavior

The file name in future debug log messages about rendering continue to show the original file name

There is more information about this in the comments starting at https://github.com/obsidian-tasks-group/obsidian-tasks/pull/894/files/0931c31b9a8033beade61024aa736f3a5467c403#r922007999

Steps to Reproduce

  • Install Tasks 1.9.0 (soon to be released)
  • Open a file with a tasks block in
  • Open the console
  • Make an edit to a task showing in the results block.
  • Confirm that the render debug messages show the block's file name
  • Rename the file
  • Make an edit to a task showing in the results block.
  • Note that the render debug messages still show the block's file old name

Context (Environment)

  • Obsidian version: 0.15.6
  • Tasks version: pre-1.9.0 release
  • [ ] I have tried it with all other plugins disabled and the error still occurs

Possible Solution

The code in src/Cache.ts that handle rename event needs a way to pass the new file name in to any tasks blocks that are in the file being renamed.

claremacrae avatar Jul 17 '22 13:07 claremacrae