Commit Graph

8 Commits (2378df05455ef790b971137cc6fdd2f2d3626465)

Author SHA1 Message Date
Your Name 32d1c0e7cc add type to function 6 days ago
Your Name 74cbc2753f fix(snowflake): avoid duplicate sequence on first two IDs
SnowflakeService::next() read the sequence with Cache::get() and, on the
non-initial branch, incremented the cache store but never refreshed the
local $seq. As a result the first two IDs in a fresh sequence both used
seq=1 (values ran 1, 1, 2, 3, ...). Two IDs generated in the same
millisecond with the same (randomly chosen) datacenter/worker then
produced identical snowflakes, causing intermittent
'UNIQUE constraint failed: statuses.id' errors — e.g. the flaky
SeasonalAggregationTest which rapidly creates several statuses.

Use Cache::increment()'s atomic post-increment return value as the
sequence so every call gets a distinct seq (1, 2, 3, ...), reseeding
when the store is empty/non-numeric and preserving the 4095 wraparound.
1 week ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Daniel Supernault 806e210f13
Update snowflake config, allow custom datacenter/worker ids 2 years ago
Daniel Supernault b32f4d91c4
Update Snowflake service 5 years ago
Daniel Supernault e5aea490b1
Refactor snowflake id generation to improve randomness 5 years ago
Daniel Supernault 0e13ab074c
Update SnowflakeService 5 years ago
Daniel Supernault c0076ab035
Add snowflake id service 6 years ago