Repository navigation
feat(FOUR-32025): Review performance: DB access and queries in login can be cached into redis, images - #8931
Conversation
…can be cached into redis, images
|
QA server K8S was successfully deployed https://ci-a186b80932.engk8s.processmaker.net |
There was a problem hiding this comment.
Code Review — feature/FOUR-32025_B vs develop
Verdict: Do not merge — 2 blockers.
1. defer breaks ProcessMaker.packages init order
Deferred bundles run after the sync inline that sets packages. Then app-login.js reassigns window.ProcessMaker and resets packages to [].
<script src="{{ mix('builds/login/js/manifest.js') }}" defer></script>
<script src="{{ mix('builds/login/js/vendor.js') }}" defer></script>
<script src="{{ mix('builds/login/js/app-login.js') }}" defer></script><script>
window.ProcessMaker = window.ProcessMaker || {};
window.ProcessMaker.packages = @json(\App::make(ProcessMaker\Managers\PackageManager::class)->listPackages());
</script>
<script src="{{ mix('js/translations/index.js') }}" defer></script>window.ProcessMaker = {
i18n: i18next,
/**
* A general use global event bus that can be used
*/
EventBus: new Vue(),
packages: [],Expected order (pre-change): app-login.js → set packages.
Actual order (with defer): set packages → app-login.js overwrites → packages = [].
Fix: keep packages assignment after app-login execution (remove defer, or set packages after boot / merge instead of replace).
2. Login caches never invalidated on branding update
<link rel="icon" href="{{ cache()->remember('login.favicon', 3600, function () { return \ProcessMaker\Models\Setting::getFavicon(); }) }}"> <div class="footer">{!! cache()->remember('login.footer_html', 3600, function () use ($loginFooterSetting) { return $loginFooterSetting->config['html']; }) !!}</div>Invalidation still only clears the old keys:
if ($request->has('fileFavicon') && $request->input('fileFavicon') !== 'null') {
$this->uploadFile($setting->refresh(), $request, 'fileFavicon', Setting::COLLECTION_CSS_FAVICON, Setting::DISK_CSS);
Cache::forget('css-favicon');
}
// Custom Login Logo
if ($request->has('fileLogin') && $request->input('fileLogin') !== 'null') {
$this->uploadFile($setting->refresh(), $request, 'fileLogin', Setting::COLLECTION_CSS_LOGIN, Setting::DISK_CSS);
Cache::forget('css-login');
}Footer update also never forgets login.footer_html:
private function setLoginFooter(Request $request)
{
$footerContent = $request->input('loginFooter', '');
// ...
Setting::updateOrCreate([
'key' => 'login-footer',
], [
'config' => ['html' => $footerContent],
]);
}Impact: favicon/footer can stay stale for up to 3600s after admin update.
Fix: Cache::forget('login.favicon') / Cache::forget('login.footer_html') on CSS override + footer save (or drop these Blade caches and rely on existing Setting/media cache-bust).
@gproly CR notes was fixed |
|
|
QA server K8S was successfully deployed https://ci-a186b80932.engk8s.processmaker.net |
PR SummaryLow Risk Overview
Login UI / assets: The logo component uses proper Reviewed by Cursor Bugbot for commit 355efdb. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 355efdb. Configure here.
|
|
||
| foreach ($mediaFile as $media) { | ||
| $url = $media->getFullUrl(); | ||
| return $url . '?id=' . $media->updated_at->timestamp; |
There was a problem hiding this comment.
Stale logo after re-upload
High Severity
Returning inside the getMedia loop selects the first collection item. Customize UI appends a new media row on every upload and Spatie orders by order_column ascending, so a replacement keeps the original file URL and updated_at cache key. Browsers then keep serving the old cached login logo, favicon, icon, or sidebar logo.
Additional Locations (3)
Reviewed by Cursor Bugbot for commit 355efdb. Configure here.







Issue & Reproduction Steps
Describe the issue this ticket solves and describe how to reproduce the issue (please attach any fixtures used to reproduce the issue).
Solution
perf.mov
How to Test
Related Tickets & Packages
Code Review Checklist
ci:deploy