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

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

Open
5 tasks done
Rmkrs opened this issue Jan 10, 2023 · 15 comments
Open
5 tasks done
Assignees
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working 📌 Keep Open [ISSUE][PR] Prevent auto-closing

Comments

@Rmkrs
Copy link

Rmkrs commented Jan 10, 2023

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 Rmkrs added the 🐛 Bug [ISSUE] Ticket describing something that isn't working label Jan 10, 2023
@liss-bot
Copy link
Collaborator

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

@Rmkrs
Copy link
Author

Rmkrs commented Jan 10, 2023

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.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Jan 10, 2023
@Rmkrs
Copy link
Author

Rmkrs commented Jan 10, 2023

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.

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Jan 11, 2023
@liss-bot

This comment was marked as off-topic.

@liss-bot liss-bot added the ⚰️ Stale [ISSUE] [PR] No activity for over 1 month label Feb 10, 2023
@Rmkrs

This comment was marked as off-topic.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels Feb 10, 2023
@liss-bot

This comment was marked as off-topic.

@liss-bot liss-bot added ⚰️ Stale [ISSUE] [PR] No activity for over 1 month and removed 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending labels Mar 13, 2023
@Rmkrs

This comment was marked as off-topic.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels Mar 13, 2023
@liss-bot

This comment was marked as off-topic.

@liss-bot liss-bot added ⚰️ Stale [ISSUE] [PR] No activity for over 1 month and removed 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending labels Apr 13, 2023
@Rmkrs

This comment was marked as off-topic.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels Apr 13, 2023
@liss-bot

This comment was marked as off-topic.

@liss-bot liss-bot added ⚰️ Stale [ISSUE] [PR] No activity for over 1 month and removed 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending labels May 14, 2023
@Rmkrs

This comment was marked as off-topic.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels May 14, 2023
@liss-bot

This comment was marked as off-topic.

@liss-bot liss-bot added ⚰️ Stale [ISSUE] [PR] No activity for over 1 month and removed 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending labels Aug 13, 2023
@Rmkrs

This comment was marked as off-topic.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels Aug 13, 2023
@liss-bot

This comment was marked as off-topic.

@liss-bot liss-bot added the ⚰️ Stale [ISSUE] [PR] No activity for over 1 month label Nov 12, 2023
@github-project-automation github-project-automation bot moved this to Todo in Dashy V3 Nov 12, 2023
@Rmkrs

This comment was marked as off-topic.

@liss-bot liss-bot removed the ⚰️ Stale [ISSUE] [PR] No activity for over 1 month label Nov 12, 2023
@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Feb 28, 2024
@CrazyWolf13 CrazyWolf13 added the 📌 Keep Open [ISSUE][PR] Prevent auto-closing label May 10, 2024
@CrazyWolf13 CrazyWolf13 self-assigned this May 10, 2024
@CrazyWolf13 CrazyWolf13 removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working 📌 Keep Open [ISSUE][PR] Prevent auto-closing
Projects
Status: Awaiting Triage
Development

No branches or pull requests

4 participants