[Sync] When opening a file via URI, sync and reload if file initially not found

Use case or problem

I have an automation setup that creates a daily brief on a different machine and then uses sync to share that across my devices. It then shares a link in whatsapp to that I can review the notes in the morning.

The problem: When I open the link, I get a file not found error as my local device hasn’t ran the sync job yet, as that presumably kicks off at the same time as Obsidian opens the file.

Proposed solution

First option that pops to mind would be check sync status, and if there’s job running/about to run let it finish and try reloading when hitting a missing file error.

Current workaround (optional)

I open the whatsapp link again (= reload manually). The page opens as by then the sync has completed.