Giter VIP home page Giter VIP logo

contargo-types's People

Contributors

bujo avatar contargo-development avatar daschjulia avatar dependabot[bot] avatar dertobsch avatar fraulyoner avatar geld0r avatar heib avatar julburg avatar olle avatar punycode avatar rjayasinghe avatar stravar avatar stwa avatar thielscher avatar vanherpen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contargo-types's Issues

Uniqueness check is not safe for concurrent modifications

So the use of a local reference to the value held in any of the concurrent maps, for example a set of string values for the email addresses of some user UUID, is not guarded against concurrent modifications.

if (dataToCheck.containsKey(key)) {
Set<String> values = dataToCheck.get(key);
// only one presence and mapped to the requester's userUUID
if (!values.isEmpty()) { // there are values for this key
if (values.size() == 1 && values.contains(value)) { // only one value equals to the requested value: unique
return true;
} else { // more values or one not equal to the requested one: not unique
logger().info("detected non-unique value {}. claimed by {} but already taken by {}.", key, value,
String.join(",", values));
return false;
}
} else {
return true;
}

I believe the checks may fail between the if-statements, in case the set is changed in an unpredictible way. We've just recorded log-statements where the non-unique value is empty, hinting at it being cleared after the check of it being empty.

I'll try to address this in a fix.

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.