freme-project / e-Link

Apache License 2.0
0 stars 0 forks source link

POST overwrites existing templates #34

Closed ghsnd closed 9 years ago

ghsnd commented 9 years ago

This is a special case. Suppose you PUT a template with ID 2147483647. This is - not by coincidence - the _MAXINT value in Java. If you then POST a template, it gets ID -2147483648 because this is the 2's complement successor of the previous ID. But from then on, all new POSTed templates get this same ID -2147483648, each time overwriting the previously posted template.

More generally, a "gap" between posts / puts is not filled; this problem is a consequense of that. E.g.,

So ID's 11 - 99 are never used.

jnehring commented 9 years ago

I suggest not to let people assign their own IDs. When you PUT a template with ID 214whatever then the service ignores this ID and assigns the next ID.

m1ci commented 9 years ago

I suggest not to let people assign their own IDs. When you PUT a template with ID 214whatever then the service ignores this ID and assigns the next ID.

I agree, will implement as you write.

m1ci commented 9 years ago

fixed, please check

ghsnd commented 9 years ago

Fixed!