agentejo / cockpit

Add content management functionality to any site - plug & play / headless / api-first CMS
http://getcockpit.com
MIT License
5.39k stars 523 forks source link

fix (Bug 1002:createMongoDbLikeId): microsecond float to big integer … #1465

Closed abernh closed 2 years ago

abernh commented 2 years ago

…before binary conversion

microseconds were omitted when using pack with format 'N', causing timestamp to be reduced to "seconds", causing high chances of equal IDs on import processes

Rel: Issue #1002

abernh commented 2 years ago

I tested the "old" and "fixed" createMongoDbLikeId() method by running it in a while loop

(my machine: Ubuntu 20, Apache, PHP7.4, Core i7-8550U, 12GB Ram)

aheinze commented 2 years ago

Thanks 👍