dashy icon indicating copy to clipboard operation
dashy copied to clipboard

[BUG] Duplicate ItemId's being generated, causing references to be made that should not be made.

Open Rmkrs opened this issue 2 years ago • 15 comments
trafficstars

Environment

Self-Hosted (Docker)

System

Chrome, 108.0.5359.125

Version

2.1.1

Describe the problem

I have some sections for managing some domains that I own. Their title is set like this:

Domain: SomeDomain.eu Domain: SomeDomain.nl

These both generate the id 1958, as can be seen in this jsfiddle

The effect this has is that if I edit items inside one section, the corresponding item in the other section gets updated too. It even generates some &ref references in the yaml config file when updating.

Additional info

No response

Please tick the boxes

Rmkrs avatar Jan 10 '23 06:01 Rmkrs

If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated

liss-bot avatar Jan 10 '23 06:01 liss-bot

I didn't have any coffee yet when I created the bug report, as it was still early for me ;) But I guess this is due to the fact that the charcodes of 'eu' combined equal the value of the charcodes of 'nl' combined:

charcode n -> 110 charcode l -> 108 makes 218

charcode e -> 101 charcode u -> 117 makes 218

So 'unhappy' coincedence I guess.

Rmkrs avatar Jan 10 '23 16:01 Rmkrs

I guess it could be fixed in a fashion similar to what I've done in this jsfiddle

Original const charSum = sectionTitle.split('').map((a) => a.charCodeAt(0)).reduce((x, y) => x + y);

Improved const charSum = sectionTitle.split('').map((a) => a.charCodeAt(0)).reduce((x, y) => ((x << 5) - x) + y) | 0;

This does produce a unique item id, even for the same input that clashed for me initially. The downside is that the unique id increases in size, from 4 to 10 digits.

Rmkrs avatar Jan 10 '23 17:01 Rmkrs

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Feb 10 '23 01:02 liss-bot

@liss-bot it is still relevant

Rmkrs avatar Feb 10 '23 07:02 Rmkrs

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Mar 13 '23 01:03 liss-bot

@liss-bot it is still relevant

Rmkrs avatar Mar 13 '23 07:03 Rmkrs

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Apr 13 '23 01:04 liss-bot

@liss-bot it is still relevant

Rmkrs avatar Apr 13 '23 05:04 Rmkrs

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar May 14 '23 01:05 liss-bot

@liss-bot it is still relevant

Rmkrs avatar May 14 '23 07:05 Rmkrs

This issue has gone 3 months without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Aug 13 '23 01:08 liss-bot

@liss-bot it is still relevant

Rmkrs avatar Aug 13 '23 09:08 Rmkrs

This issue has gone 3 months without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Nov 12 '23 01:11 liss-bot

@liss-bot it is still relevant

Rmkrs avatar Nov 12 '23 07:11 Rmkrs