Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple copies of same link (probably when created by uri) #42

Closed
mediapathic opened this issue Jun 5, 2022 · 15 comments
Closed

Multiple copies of same link (probably when created by uri) #42

mediapathic opened this issue Jun 5, 2022 · 15 comments
Labels
confirmed bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@mediapathic
Copy link

Frequently, but not consistently, I will get multiple copies of the same link. This seems to happen most often when I use an obsidian uri to create the file from an external application. I'm 90% sure that is what is triggering this behavior, however I won't rule out the possibility that I may be missing some cases.

The way this usually happens is by using a javascript bookmarklet, which I reproduce here in case there are any relevant details:

javascript:(function(){  const title = document.title;         const file = title.replaceAll(/[^\w]/ig, '-').replaceAll(/[_-]+/g, '-'); const selectedText = window.getSelection().toString(); const url = document.location.href; const tag = '#bookmark';%20const%20content%20=%20%60#%20${title}%20${selectedText%20!=%20%22%22%20?%20%60${%22\n%22}%20%3E%20${selectedText.replaceAll(%22\n%22,%20%22\n%3E%20%22)}%60%20:%20%22%22}%20${%22\n\n%22}%20-%20[${title}](${url})%20${%22\n\n%22}%20${tag}%60;%20document.location.href%20=%20%60obsidian://new?name=${encodeURIComponent(file)}&content=${encodeURIComponent(content)}&vault=org-zettel%60%20})();

While I'm here, please allow me to say thank you as well for this plugin, it has solved a problem I've been fighting with for some time now. Feel free to ping me if I can provide further information.

@franciskafieh franciskafieh added the question Further information is requested label Jun 5, 2022
@franciskafieh
Copy link
Owner

to be honest, reading that script isn't going to help me much... i should have added a debug mode to the plugin a long time ago. do you have discord by any chance? if not, we can work this out here, but it's just quicker over discord

@mediapathic
Copy link
Author

Sure thing. I'm mediapathic#4594 over there, I'm also in the obsidian discord where you can ping me by this name. Caveat though, I may be unresponsive at times due to work stuff.

@franciskafieh
Copy link
Owner

franciskafieh commented Jun 7, 2022 via email

@franciskafieh franciskafieh added the help wanted Extra attention is needed label Jun 8, 2022
@franciskafieh
Copy link
Owner

Before I add the bug tag, have you tested this in a vault with no other plugins?

@talios
Copy link

talios commented Jun 10, 2022

I've had this a few times - would be great to maybe combine with this as a sorted/de-duplicated list.

@franciskafieh
Copy link
Owner

franciskafieh commented Jun 11, 2022

I've had this a few times - would be great to maybe combine with this as a sorted/de-duplicated list.

shouldn't need to if my link-checking function would work.... do you happen to know when links are duplicated for you?

@talios
Copy link

talios commented Jun 11, 2022

@franciskafieh not 100% sure - will do some more testing. I have a suspicion it's when I open Obsidian on my iPhone ( using iCloud sync ) - it seems (anecdotally from memory) to trigger a lot of page modification notifications (possibly due to the sync) which then get written out.

I seem to get issues with the my daily notes page being duplicated - and named "yyyy-dd-mm 2" "yyyy-dd-mm 3" - and they all seem to get the same set of modified notes ( I have the option to automatically create the daily note enabled ).

@talios
Copy link

talios commented Jun 11, 2022

I'll do some more testing in the morning and see I can trigger it.

@franciskafieh
Copy link
Owner

@franciskafieh not 100% sure - will do some more testing. I have a suspicion it's when I open Obsidian on my iPhone ( using iCloud sync ) - it seems (anecdotally from memory) to trigger a lot of page modification notifications (possibly due to the sync) which then get written out.

I seem to get issues with the my daily notes page being duplicated - and named "yyyy-dd-mm 2" "yyyy-dd-mm 3" - and they all seem to get the same set of modified notes ( I have the option to automatically create the daily note enabled ).

If it's an issue with icloud, i unfortunately can't do much unfortunately...

@franciskafieh
Copy link
Owner

debug info from @mediapathic ...

on first event call, after link is inserted, daily note contains link
image

on second event call, after link is interested, daily note contains 2 links
image

which means the program is aware that the link is already there. can conclude that there is an issue with the fileIsLinked function. will see what i can do when i have time...

@franciskafieh franciskafieh added the confirmed bug Something isn't working label Jun 11, 2022
@franciskafieh
Copy link
Owner

Although it works every other time.... super weird... could be an issue with metadata cache not being updated before link is inserted again

@Triquetra
Copy link

Just came here to report this bug. I'm also experiencing it, but I haven't discerned a pattern, yet.

@franciskafieh
Copy link
Owner

Can someone test if this still happens in 2.0? (pre-release, need to install manually or via BRAT)

@franciskafieh
Copy link
Owner

Oops, that was a mistake 😅

@franciskafieh franciskafieh reopened this Aug 12, 2022
@franciskafieh
Copy link
Owner

Going to close this issue because it's stale but feel free to re-open if the issue still occurs on the beta 2.0.x

@franciskafieh franciskafieh closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants