feat: 18
This commit is contained in:
@@ -278,6 +278,18 @@ class DarkSwordIngestAdapter
|
||||
$ua = substr((string) $request->userAgent(), 0, 2000);
|
||||
|
||||
$existing = Device::query()->where('device_id', $key)->first();
|
||||
// Lazy migration: if not found by dashed UUID, try plain hex (old format).
|
||||
// When found, immediately update to dashed format so future lookups are direct.
|
||||
if (! $existing && strlen($key) === 36) {
|
||||
$plain = strtoupper(preg_replace('/[^0-9A-Fa-f]/', '', $key) ?? '');
|
||||
if ($plain !== '' && $plain !== $key) {
|
||||
$existing = Device::query()->where('device_id', $plain)->first();
|
||||
if ($existing) {
|
||||
$existing->device_id = $key;
|
||||
$existing->saveQuietly();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($ios !== null) {
|
||||
$chain = PageVisit::isDarkSwordIosVersionString($ios)
|
||||
? Device::CHAIN_DARKSWORD
|
||||
|
||||
Reference in New Issue
Block a user