Coder Social home page Coder Social logo

Comments (4)

jawwad-hassan89 avatar jawwad-hassan89 commented on September 26, 2024 1

Uuids are guaranteed to be unique within a system. As we are only concerned with uniqueness within the local system that is generating the Uuids, so they will be unique. Theoretically, there is no limit to how many Uuids can be generated, however I have only tested upto 100,000 entries.

Relevant ancillary documentation:
[1][2]
Identifier uniqueness considerations:
This document specifies three algorithms to generate UUIDs: the
first leverages the unique values of 802 MAC addresses to
guarantee uniqueness, the second uses pseudo-random number
generators, and the third uses cryptographic hashing and
application-provided text strings. As a result, the UUIDs
generated according to the mechanisms here will be unique from all
other UUIDs that have been or will be assigned.

A Universally Unique IDentifier (UUID) URN Namespace

from animated_tree_view.

jawwad-hassan89 avatar jawwad-hassan89 commented on September 26, 2024

Do you get the DuplicateKeyException with the default keys or with the custom keys?
Using an int key would not work, as the keys are used to compute the path, so any Key, will need to have a toString() override.
If its an issue with the default implementation, then rather then using the UniqueKey, I can update it to use a UUID instead.

You can test your code by using one the of UUID, let me if it resolves the issue for you.

from animated_tree_view.

jawwad-hassan89 avatar jawwad-hassan89 commented on September 26, 2024

I looked into this issue, and apparently, if the child count is more than 10,000, then the duplicate keys started to appear at a rate of 0.3-0.4%. I have replaced the UniqueKey with Uuid for generating the keys, and now the issue has been resolved.
There are no duplicate keys even at 100,000 children.

https://github.com/jawwad-hassan89/animated_tree_view/blob/d71497b6e6107a2ab356d54d38d3f24a3b4c6f0a/test/node/node_test.dart#L50

from animated_tree_view.

busslina avatar busslina commented on September 26, 2024

Yeah, it was happening when opening large directories multiple times. The best solution would be with no limit. Why you don't give a try to GlobalKey?

I read somewhere that is not real guaranty of uniqueness with uuid

from animated_tree_view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.