NotificationRegistry::notify() reads company settings from the session, but its callers are queued listeners
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by locating NotificationRegistry::notify(), Setting::lookupCompany(), and the queued Fleetbase\FleetOps\Listeners\NotifyOrderEvent callers. Trace how the queued subject exposes company_uuid and how notifyUsingDefinitionName() reads settings. Done means queued notifications honor per-company notification_settings without a session, while retaining the stated session fallback when no company is available.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
NotificationRegistry::notify() loads per-company settings with Setting::lookupCompany('notification_settings'), which bails out when there is no session:
public static function lookupFromCompany(string $key, $defaultValue = null)
{
if (session()->missing('company')) {
return $defaultValue;
}
return static::lookup('company.' . session('company') . '.' . $key, $defaultValue);
}
Its callers are queued: Fleetbase\FleetOps\Listeners\NotifyOrderEvent implements ShouldQueue. In the queue worker there is no session, $settings comes back empty, and the method notifies nobody.
Impact
On any deployment where the queue runs as its own process or container — including the documented docker-compose setup — everything configured in Settings → Notifications is silently ignored. The order notifications that do arrive are the hardcoded ones from HandleOrderDriverAssigned, HandleOrderDispatched, HandleOrderCanceled and HandleOrderDispatchFailed, which never consult the settings. The net effect is that the settings screen appears to have no consequence, while recipients can only be added, never removed.
Versions
core-api 1.6.62 (Fleetbase v0.7.63); same code in 1.6.61.
Suggested fix
Resolve the company from the subject passed in $params (e.g. its company_uuid) and read company.<uuid>.notification_settings directly, falling back to the session only when the subject carries no company.
Note
notifyUsingDefinitionName() nearby reads Setting::lookup('notification_settings') — the global key, with no company prefix — which looks like a separate inconsistency.
- Lingua principale
- PHP
- Stelle
- 17
- Fork
- 39
- Merge medio
- 1g 9h
- PR unite (30g)
- 17
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fleetbase/core-api
-
Invited non-admin users cannot set their password: set-password requires 'create user' permission Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
enhancement good first issue help wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di fleetbase/core-api
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
octobercms/october#6130 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
getgrav/grav-plugin-form#656 ·
-
customer-support needs-triage Platform(Default)
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100