Internal Note's Links II
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Internal Note's Links II
Hi Alex,
there is still an issue with internal links to other notes. I can not reproduce, but the link recognition gets broken. It looks like some internal offset calculation misses something. I just had this again with a note containing many bullet lists, paragraphs, HTML Links and note links.
I know this does not help much, but want to make sure you are aware of the issue.
Thomas
there is still an issue with internal links to other notes. I can not reproduce, but the link recognition gets broken. It looks like some internal offset calculation misses something. I just had this again with a note containing many bullet lists, paragraphs, HTML Links and note links.
I know this does not help much, but want to make sure you are aware of the issue.
Thomas
- ChrisCN
- Posts: 223
- Joined: Wed Jul 04, 2012 10:20 am
- Contact:
Re: Internal Note's Links II
Hi
I can confirm, that this happens to me over and over again.
But - like Thomas - I have not noticed any "actions" that can provoke this.
One suspicion was that cutting-and-pasting other parts of the note could lead to this problem - but I am not really sure about that![Confused :?](./images/smilies/icon_e_confused.gif)
I can confirm, that this happens to me over and over again.
But - like Thomas - I have not noticed any "actions" that can provoke this.
One suspicion was that cutting-and-pasting other parts of the note could lead to this problem - but I am not really sure about that
![Confused :?](./images/smilies/icon_e_confused.gif)
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
Hi Chris,
thanks for confirming the issue. I always felt like i am the only one facing this. It is also interesting that you are seeing the issue quite often. The bug affects internal note links only, which is important for bug tracking. HTML links appear to work fine. I also observed that the issue might correlate with copy&paste actions. I don't remember any case when the bug would happen and i would immediately notice it. Usually i notice that the note got broken when i open it up the next time. This implies that the bug might affect text which is out of sight in the editor (not in the visible area) or that the bug does not affect the editor right away.
There is no workaround, but here are steps to clean up the mess in case anyone is facing the issue:
Thomas
thanks for confirming the issue. I always felt like i am the only one facing this. It is also interesting that you are seeing the issue quite often. The bug affects internal note links only, which is important for bug tracking. HTML links appear to work fine. I also observed that the issue might correlate with copy&paste actions. I don't remember any case when the bug would happen and i would immediately notice it. Usually i notice that the note got broken when i open it up the next time. This implies that the bug might affect text which is out of sight in the editor (not in the visible area) or that the bug does not affect the editor right away.
There is no workaround, but here are steps to clean up the mess in case anyone is facing the issue:
- set the caret on the link (which might be text that should not be part of the link)
- press Shift+Alt+D to delete the link (it will delete the reference but preserve the text)
- select the text of the note that should be referenced
- press Shift+Alt+N to create a new link (it should show up the desired note in the selection box)
- press Enter to confirm
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Internal Note's Links II
Thomas, Chris,
Thank a lot for the detailed report!
I'll pass this on to Denis to investigate, as he is responsible for the note links feature.
Thank a lot for the detailed report!
I'll pass this on to Denis to investigate, as he is responsible for the note links feature.
Alex
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Internal Note's Links II
Denis reports that despite multiple attempts, he was not able to reproduce the problem.
There must be some action that shifts the links. We just need to find it..
Any ideas? Thanks!
There must be some action that shifts the links. We just need to find it..
Any ideas? Thanks!
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
CintaNotes Developer wrote:Denis reports that despite multiple attempts, he was not able to reproduce the problem. There must be some action that shifts the links. We just need to find it.. Any ideas? Thanks!
There is no need in trying to reproduce the problem. You can't, because it is so hard to catch the moment it actually happens. Since it is related to internal links the code can be reviewed and compared to the html-link-handling. Possibly by another developer than the guy who coded it. What i do to catch such issues is to implement what i call a "fighter-interceptor". Add some code that observes and catches circumstances which must not happen. It is a kind of dynamic assert. In the case here one could track captions of all internal links (save them to a memory list) and their offset in the text. On any action test whether the saved captions still match the tracked (current) captions. In case they changed it is likely because of a change of the offset. In case of a failure warn the user and undo the last action. This should prevent the note from getting corrupted and should help to catch the steps necessary to reproduce the problem.
Thomas
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
One more time - just had it again creating a new note!
I tried to reproduce immediately - as usual without success.
The result text looks like this:
Title
Title
Title
Features i used:
Remarks:
Thomas
I tried to reproduce immediately - as usual without success.
The result text looks like this:
Title
- skadjfhjwdehf
- skdjfhjksdhf
- öldkjdfsjdhf
Title
- nmskdjfhsjdhf
Title
- Internal Link #1
- Internal Link #2
Features i used:
- lists with plain text
- lists with internal links (not just one)
- Ctrl+Shift+U to format headlines
Remarks:
- the internal links appear at the end of the text
- the problem got obvious only after re-opening the note
Thomas
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
I can reproduce ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
I think it has to do with the handling of unicode characters, calculating their length respectively. At least this nails down one issue, maybe there are others left. The future will tell.
Steps to reproduce:
* create a new note
* press arrow-down to set caret to note's text
* press Ctrl+L
* press Alt+Shift+N
* search for a note reference
* press Enter to confirm and create an internal link
* press Home to set caret to position 1
* press Enter
* press up-arrow
* type some text, such as "bla bla €" ==> beware of the Euro-Symbol here!!!
* press Esc to save and exit
* re-open the note
=> voilà - there we go
No doubt - i am the best![Wink ;)](./images/smilies/icon_e_wink.gif)
Thomas
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
I think it has to do with the handling of unicode characters, calculating their length respectively. At least this nails down one issue, maybe there are others left. The future will tell.
Steps to reproduce:
* create a new note
* press arrow-down to set caret to note's text
* press Ctrl+L
* press Alt+Shift+N
* search for a note reference
* press Enter to confirm and create an internal link
* press Home to set caret to position 1
* press Enter
* press up-arrow
* type some text, such as "bla bla €" ==> beware of the Euro-Symbol here!!!
* press Esc to save and exit
* re-open the note
=> voilà - there we go
No doubt - i am the best
![Wink ;)](./images/smilies/icon_e_wink.gif)
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Internal Note's Links II
Thomas, yes you are! ![Smile :)](./images/smilies/icon_e_smile.gif)
I could reproduce, albeit only after I installed and used German layout to type that euro symbol.
Was this symbol present in your previously corrupted notes?
![Smile :)](./images/smilies/icon_e_smile.gif)
I could reproduce, albeit only after I installed and used German layout to type that euro symbol.
Was this symbol present in your previously corrupted notes?
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
CintaNotes Developer wrote:I could reproduce, albeit only after I installed and used German layout to type that euro symbol.
You should be able to enter the symbol directly by holding the Alt-key and typing 20ac
CintaNotes Developer wrote:Was this symbol present in your previously corrupted notes?
Yes, i checked for the note which got corrupted on March 10. It also includes the euro symbol (before the internal note links).
Thomas
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
To all interested the problem is related to the computers handling of characters. This link gives an explanation http://www.firstobject.com/dn_markansifile.htm.
As one can see when using UTF-8 the Euro-symbol takes three bytes of storage. In case the software expects UTF-16 it calculates its size with one byte less, than necessary, causing the shift one can see in the editor. Because of that using other characters which take more than the usual two bytes will also cause the bug.
Thomas
As one can see when using UTF-8 the Euro-symbol takes three bytes of storage. In case the software expects UTF-16 it calculates its size with one byte less, than necessary, causing the shift one can see in the editor. Because of that using other characters which take more than the usual two bytes will also cause the bug.
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Internal Note's Links II
Thomas Lohrum wrote:You should be able to enter the symbol directly by holding the Alt-key and typing 20ac
In this case the error doesn't occur (and it's Alt+0128). This is a "Ctrl+Alt" problem.
Thomas Lohrum wrote:Yes, i checked for the note which got corrupted on March 10. It also includes the euro symbol (before the internal note links).
So if we are lucky seems that you've found the culprit.
But still we'll need to implement that watchdog, just to be sure.
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
CintaNotes Developer wrote:So if we are lucky seems that you've found the culprit.
Can "ChrisCN" confirm the problem here?
CintaNotes Developer wrote:But still we'll need to implement that watchdog, just to be sure.
Implementing the watchdog can be tricky and takes time. It might also slow down the editor noticeably. Since we now have a good catch, i think it is ok to not implement the watchdog right away. A positive confirmation by ChrisCN will back up such the decision. I'd rather spend the time to check the code for relevant parts which also influence calculations of character length.
Thomas
-
- Posts: 234
- Joined: Fri Nov 08, 2013 5:35 am
- Contact:
Re: Internal Note's Links II
Excellent catch, Thomas! This sort of problem comes up when dealing with variable-length characters (UTF-8, DBCS, etc) where a character is not necessarily a fixed 8 (or 16 or 32) bits. Accented characters outside the Western European set would probably have triggered it also.
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
Hi Alex,
i checked for older notes that might also be affected by the UTF-8 bug. It was rather hard to search for them, since i don't know of an easy way to filter notes that contain internal links. Still i found a note that i created and last modified in February. In the very first line it does contain a link that is corrupted. The note does not contain the euro-symbol. By its title i don't think it ever contained one. Also i was not able to see an obvious UTF-8 character that might have caused the issue. After all the UTF-8 bug might not be the only one.
Do we need the watchdog at last?
Thomas
i checked for older notes that might also be affected by the UTF-8 bug. It was rather hard to search for them, since i don't know of an easy way to filter notes that contain internal links. Still i found a note that i created and last modified in February. In the very first line it does contain a link that is corrupted. The note does not contain the euro-symbol. By its title i don't think it ever contained one. Also i was not able to see an obvious UTF-8 character that might have caused the issue. After all the UTF-8 bug might not be the only one.
![Sad :(](./images/smilies/icon_e_sad.gif)
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Internal Note's Links II
Thanks Thomas, that's worrisome.
I think we'll still implement the watchdog, just will make it optional so that its doesn't hog resources by default.
Could this note have been created before we fixed previous bugs in link place bookkeeping?
I think we'll still implement the watchdog, just will make it optional so that its doesn't hog resources by default.
Could this note have been created before we fixed previous bugs in link place bookkeeping?
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
CintaNotes Developer wrote:Could this note have been created before we fixed previous bugs in link place bookkeeping?
Sorry, i am afraid the answer is no. The last fix to internal notes was back in 2014 (September/October???). My note was created on Feb. 06 2015.
Thomas
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
I've just been working on a rather large note containing many note links. Most of them as part of lists. There was a € symbol included at some time. However, i had deleted that part of the note before and reopened it, before i noticed the problem. I did some copy&paste, deleted text, deleted note links (the text including the link by selecting the text and pressing Del), did some editing....and noticed that an internal link at the very end of the note text just got corrupted. Sorry, this involved complex editing of the note. No easy way of reproducing my steps.
Also there were a couple of note links that i had corrected a couple of days ago. But today i realized they all referenced one single note, though their caption was unique.
Thomas
Also there were a couple of note links that i had corrected a couple of days ago. But today i realized they all referenced one single note, though their caption was unique.
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Internal Note's Links II
Thomas, thanks for the latest comments. Ok, so the summary is: complex editing actions can still trigger "link wandering". All the more reason to implement the debug watchdog.
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Internal Note's Links II
The € symbol does affect file links also (created by Alt+Shift+F). I've just had such a case.
Thomas
Thomas