
`file:` URIs in task title or notes do not work as expected when clicked
Hello, I believe I have encountered a bug in Microsoft Todo. I would like to file a bug report, but I can't seem to find the issue tracker (if there is one), so I'm posting it here instead.
Bug Description
A while back I added a task that was related to a folder of files stored locally on my device. I decided to copy-paste the path to the folder in the task notes so I wouldn't have to spend extra time locating the folder every time I wanted to work on this task. This way I could just copy the path from the task notes and paste it into Explorer's filepath-bar (or the Run dialog) to jump to it. But then I decided it would be even more convenient if I added the path as a file: URI so I could just click on it and get an explorer window opened to the folder. So I added the text file:///C:/Users/username/path/to/folder (just an example) within the notes of the task and saved it. The URI got lit up blue as expected, but nothing happens when I click on it (even if the same URI works both when passed to the start command in Command Prompt and pasted in the Run dialog). I tried many difference forms of the same URI (such as using forward slashes v.s. backslashes, URL-encoding v.s. not URL-encoding), and found that only URL-encoding the filepath would cause the resulting URI to respond to clicks. But it would open Microsoft Edge (instead of Explorer!) to a mangled version of the filepath given in the body of the URI. For instance, when I click file://C%3A/Users/username, it opens Microsoft Edge to the URL https://file//C%3A/Users/username, which obviously fails to load. This should probably be fixed?
Tests
During my testing, I created a new task and wrote the below in the Notes section:
Zero: Other URI schemes (all work correctly):
ms-calculator:///
ms-clock:///
ms-settings:display
ms-settings:taskbar
══════════════════════════════
One: File URIs to folder (none of them work):
1. Forward-slashes
file:C:/Users/username/Documents
file://C:/Users/username/Documents
file:///C:/Users/username/Documents
2. Back-slashes
file:C:\Users\username\Documents
file://C:\Users\username\Documents
file:///C:\Users\username\Documents
──────────────────────────────
Two: URL-encoded File URIs to folder (some of them actually respond to clicks, but behave incorrectly):
1. Normal forward-slashes
file:C%3A/Users/username/Documents
file://C%3A/Users/username/Documents
file:///C%3A/Users/username/Documents
2. Normal back-slashes
file:C%3A\Users\username\Documents
file://C%3A\Users\username\Documents
file:///C%3A\Users\username\Documents
3. URL-encoded back-slashes
file:C%3A%5CUsers%5Cusername%5CDocuments
file://C%3A%5CUsers%5Cusername%5CDocuments
file:///C%3A%5CUsers%5Cusername%5CDocuments
══════════════════════════════
Three: File URIs to file (none of them work):
1. Forward-slashes
file:C:/Users/username/Documents/Test.py
file://C:/Users/username/Documents/Test.py
file:///C:/Users/username/Documents/Test.py
2. Back-slashes
file:C:\Users\username\Documents\Test.py
file://C:\Users\username\Documents\Test.py
file:///C:\Users\username\Documents\Test.py
──────────────────────────────
Four: URL-encoded File URIs to file (some of them actually respond to clicks, but behave incorrectly):
1. Normal forward-slashes
file:C%3A/Users/username/Documents/Test.py
file://C%3A/Users/username/Documents/Test.py
file:///C%3A/Users/username/Documents/Test.py
2. Normal back-slashes
file:C%3A\Users\username\Documents\Test.py
file://C%3A\Users\username\Documents\Test.py
file:///C%3A\Users\username\Documents\Test.py
3. URL-encoded back-slashes
file:C%3A%5CUsers%5Cusername%5CDocuments%5CTest.py
file://C%3A%5CUsers%5Cusername%5CDocuments%5CTest.py
file:///C%3A%5CUsers%5Cusername%5CDocuments%5CTest.py
C:\Users\username\Documents\Test.py is a simple Python file that opens a command prompt window and holds it open until any key is pressed, so I would know if the file URI worked. None of the test cases successfully ran the file when its URI was clicked in ToDo. Here are its contents:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import msvcrt
print("It worked!")
print("Press any key to continue . . . ", end="", flush=True)
msvcrt.getch()
And here are the test results:
Test Number | Test URI | Behavior in Command Prompt start command (start "" "<URI Here>") | Behavior in Run dialog | Behavior in Microsoft ToDo (on click) |
---|---|---|---|---|
0.1 | ms-calculator:/// | Works as expected. | Works as expected. | Works as expected. |
0.2 | ms-clock:/// | Works as expected. | Works as expected. | Works as expected. |
0.3 | ms-settings:display | Works as expected. | Works as expected. | Works as expected. |
0.4 | ms-settings:taskbar | Works as expected. | Works as expected. | Works as expected. |
1.1.1 | file:C:/Users/username/Documents | Works as expected. | Works as expected. | Nothing happens. |
1.1.2 | file://C:/Users/username/Documents | Works as expected. | Works as expected. | Nothing happens. |
1.1.3 | file:///C:/Users/username/Documents | Works as expected. | Works as expected. | Nothing happens. |
1.2.1 | file:C:\Users\username\Documents | Works as expected. | Works as expected. | Nothing happens. |
1.2.2 | file://C:\Users\username\Documents | Works as expected. | Works as expected. | Nothing happens. |
1.2.3 | file:///C:\Users\username\Documents | Works as expected. | Works as expected. | Nothing happens. |
2.1.1 | file:C%3A/Users/username/Documents | Works as expected. | Works as expected. | Isn't even clickable. |
2.1.2 | file://C%3A/Users/username/Documents | Error dialog. | Error dialog. | Opens Microsoft Edge to the URL https://file//C%3A/Users/username/Documents |
2.1.3 | file:///C%3A/Users/username/Documents | Error dialog. | Error dialog. | Nothing happens. |
2.2.1 | file:C%3A\Users\username\Documents | Works as expected. | Works as expected. | Isn't even clickable. |
2.2.2 | file://C%3A\Users\username\Documents | Error dialog. | Error dialog. | Opens Microsoft Edge to the URL https://file//C%3A/Users/username/Documents |
2.2.3 | file:///C%3A\Users\username\Documents | Error dialog. | Error dialog. | Nothing happens. |
2.3.1 | file:C%3A%5CUsers%5Cusername%5CDocuments | Works as expected. | Works as expected. | Isn't even clickable. |
2.3.2 | file://C%3A%5CUsers%5Cusername%5CDocuments | Error dialog. | Error dialog. | Opens Microsoft Edge to the URL https://file//C%3A%5CUsers%5Cusername%5CDocuments |
2.3.3 | file:///C%3A%5CUsers%5Cusername%5CDocuments | Error dialog. | Error dialog. | Nothing happens. |
3.1.1 | file:C:/Users/username/Documents/Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Nothing happens. |
3.1.2 | file://C:/Users/username/Documents/Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Nothing happens. |
3.1.3 | file:///C:/Users/username/Documents/Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Nothing happens. |
3.2.1 | file:C:\Users\username\Documents\Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Nothing happens. |
3.2.2 | file://C:\Users\username\Documents\Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Nothing happens. |
3.2.3 | file:///C:\Users\username\Documents\Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Nothing happens. |
4.1.1 | file:C%3A/Users/username/Documents/Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Isn't even clickable. |
4.1.2 | file://C%3A/Users/username/Documents/Test.py | Error dialog. | Error dialog. | Opens Microsoft Edge to the URL https://file//C%3A/Users/username/Documents/Test.py |
4.1.3 | file:///C%3A/Users/username/Documents/Test.py | Error dialog. | Error dialog. | Nothing happens. |
4.2.1 | file:C%3A\Users\username\Documents\Test.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Isn't even clickable. |
4.2.2 | file://C%3A\Users\username\Documents\Test.py | Error dialog. | Error dialog. | Opens Microsoft Edge to the URL https://file//C%3A/Users/username/Documents/Test.py |
4.2.3 | file:///C%3A\Users\username\Documents\Test.py | Error dialog. | Error dialog. | Nothing happens. |
4.3.1 | file:C%3A%5CUsers%5Cusername%5CDocuments%5CTest.py | Successfully starts a new Command Prompt instance running the Python program. | Successfully starts a new Command Prompt instance running the Python program. | Isn't even clickable. |
4.3.2 | file://C%3A%5CUsers%5Cusername%5CDocuments%5CTest.py | Error dialog. | Error dialog. | Opens Microsoft Edge to the URL https://file//C%3A%5CUsers%5Cusername%5CDocuments%5CTest.py |
4.3.3 | file:///C%3A%5CUsers%5Cusername%5CDocuments%5CTest.py | Error dialog. | Error dialog. | Nothing happens. |
In conclusion, while other URI schemes work, file: URIs never works correctly, and either ignores clicks entirely or opens it in Microsoft Edge (with a mangled URL) instead of File Explorer (if the path is to a folder) or the program associated with the file (if the path is to a file). It would really be nice if this was fixed so file: URIs worked correctly.### Related Android Bug
Another related bug I encountered is that on the Android version of Microsoft ToDo, clicking on a file: URI that is clickable (highlighted in blue) instantly causes the app to crash and send me back to the homescreen. I tested this multiple times and it is 100% reproducible for me. It's a while since I noticed this, so not sure if this bug still exists. To reproduce, just create a task with a file: URI anywhere in the task title or Notes, and then tap it when it lights up in blue.
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
