obsidian-dataview: Bug report: excessive refreshing

What happened?

the query refreshes too much, when editing a file in another pane.

https://user-images.githubusercontent.com/38974541/167502627-87a7b1b2-78cf-4fe9-87e2-01caafb38600.mov

DQL

No response

JS

let text
let groups = dv.pages('#project')
	.where(p => p.date?.toISODate() != time && !p.file.path.includes('templates'))
	.sort(p => p.impact)
	.sort(p => p.class, 'desc')
	.sort(p => p.deadline)
	.sort(p => p.file.tasks.completed.includes(false),'desc')
	.sort(p => p.date?.toISODate() > time)
	.groupBy(p => p.theme)

for (let group of groups.sort(g => g.key, 'desc')) {
	if (!group.key) {
		dv.header(4, 'ST')
	} else {
		dv.header(4, group.key)	
	}
	dv.list(group.rows.map(t => {
		if (!t.file.tasks.completed.includes(false)) {
			text =  '☑️ ' + t.file.link
		} else if (t.file.tasks.completed.includes(false) && (t.date?.toISODate() <= time) || !t.date) {
			text = '⛓ ' + t.file.link
		} else if (t.date?.toISODate() > time) {
			text = '🗓 ' + t.file.link
		} else {
			text = t.file.link
		}
		if (t.deadline !== null) {
			text = text + " (" + Math.ceil(t.deadline.diff(DateTime.now()).as('days')) + ")"
		}
		return text
	}))
}


### Dataview Version

0.5.19

### Obsidian Version

0.14.6

### OS

MacOS

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 4
  • Comments: 25 (8 by maintainers)

Commits related to this issue

Most upvoted comments

For a simple fix for right now I recommend upping the refresh interval to 2500 or 5000; this doesn’t fix the root problem, but will make it a little less annoying for you.

I’m not quite sure what changed between stable and beta to cause this behavior (the renderer is unchanged), but I think the correct fix is an improvement to the DataviewJS render API to eliminate the annoying refresh behavior in the first place.

@danrthompson Do you mean Dataview: Force Refresh All Views and Blocks? I tried that but that doesn’t do anything for me

Force Refresh has a bug: https://github.com/blacksmithgu/obsidian-dataview/issues/1752

@charleshan I did find a solution to this. I turned off automatic view refreshing, and then I assigned a keyboard shortcut (option-R) to refresh dataview queries. So now, when I open a file that has a query, I just immediately run the shortcut. Ditto if I want to see updated content. That way there isn’t flickering, but it’s super easy to get the results quickly.

How about making it update (flicker) only when there’s a change in the output?

@AB1908 You’re talking to blacksmithgu right ?