Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
21054c6
FOUR-32126: INBOX >> First loading is to slow
rodriquelca Jul 28, 2026
b607dd8
feat: implement ETag middleware for Tasks page caching
devmiguelangel Jun 10, 2026
5ecf0f4
feat: update inbox and tasks routes to use ETag middleware for improv…
devmiguelangel Jun 10, 2026
8677dab
feat: enhance BrowserCache middleware to return response if ETag head…
devmiguelangel Jun 10, 2026
89c0183
test: add ETag handling tests for Tasks page to ensure proper caching…
devmiguelangel Jun 10, 2026
34bb989
feat: optimize TasksPageEtag for permission handling and user configu…
devmiguelangel Jun 11, 2026
c4f7e1f
fix: update inbox route to use no-cache middleware for improved respo…
devmiguelangel Jun 11, 2026
fd5cebc
docs: add Tasks Page ETag Sequence documentation
devmiguelangel Jun 11, 2026
9cf4563
feat: add api client caching functionality
devmiguelangel Jun 18, 2026
7b3f11f
feat: add debug logging to api client cache for improved diagnostics
devmiguelangel Jun 18, 2026
dfc6091
feat(FOUR-31831): review Improve Task page loading
rodriquelca Jun 19, 2026
40fc24a
fix: code style
rodriquelca Jun 19, 2026
e01a75f
feat: enhance api client cache with additional utility functions and …
devmiguelangel Jun 19, 2026
93f4e68
feat: return original request in api client cache to maintain promise…
devmiguelangel Jun 19, 2026
4489b89
test: add comprehensive tests for api client cache functionality
devmiguelangel Jun 19, 2026
cb592e8
Adding indexOptimized method to taskController api-1.1
AugustoLopezProcess Jun 19, 2026
4ee7901
Adding optimization parameter to nonSystem
AugustoLopezProcess Jun 19, 2026
a5ce0c5
Adding taskOptimized route to api.php v1.1
AugustoLopezProcess Jun 19, 2026
e4a1759
Adding indexOptimizedBaseQuery method
AugustoLopezProcess Jun 19, 2026
8a510a9
Adding config value from env, to activate the optimized endpoint on 1.1
AugustoLopezProcess Jun 23, 2026
c192ab0
feat(FOUR-32800): add v1.1 task completion endpoint with raw SQL path
gproly Aug 28, 2026
6795511
feat(FOUR-32801): improve Jobs execution when the PUT tasks endpoint …
rodriquelca Aug 28, 2026
3fc16e0
style(FOUR-32800): reorder imports in task completion raw service files
gproly Aug 28, 2026
b55a89c
Merge branch 'develop' into feature/FOUR-32800
gproly Sep 2, 2026
05c05a4
perf(FOUR-32947): reduce N+1 queries on requests listing (FOUR-32947)
gproly Sep 4, 2026
a5f315b
FOUR-32800: test compares legacy and optimized
pmPaulis Sep 7, 2026
da5e64f
Merge pull request #9021 from ProcessMaker/bugfix/FOUR-32801
pmPaulis Sep 8, 2026
5e7ca61
Merge pull request #9020 from ProcessMaker/feature/FOUR-32800
pmPaulis Sep 8, 2026
c2ea6f6
feat(FOUR-32800): solving observation about starts
pmPaulis Sep 8, 2026
daafb12
Merge pull request #9046 from ProcessMaker/feature/FOUR-32800
pmPaulis Sep 8, 2026
f600087
feat: optimize notification settings retrieval in Process model
devmiguelangel Sep 10, 2026
b36b825
feat: enhance process retrieval logic by refining relationship handli…
devmiguelangel Sep 10, 2026
a550247
feat: correct query parameters in ProcessMixin to ensure proper data …
devmiguelangel Sep 10, 2026
fdd28de
test: add tests for process listing, including pagination, sorting, a…
devmiguelangel Sep 11, 2026
009273c
Merge branch 'develop' into task/FOUR-32144
gproly Sep 28, 2026
c527057
Merge remote-tracking branch 'origin/develop' into FOUR-32946
devmiguelangel Oct 5, 2026
499436d
fix(FOUR-33645): guard activity execution time metric when ms timesta…
gproly Oct 6, 2026
e314c13
Merge pull request #9045 from ProcessMaker/task/FOUR-32144
pmPaulis Oct 8, 2026
2d97d70
Merge pull request #9056 from ProcessMaker/FOUR-32946
pmPaulis Oct 8, 2026
c1e2d66
Merge pull request #9036 from ProcessMaker/feature/FOUR-32947
pmPaulis Oct 8, 2026
8ab48d6
Merge pull request #9090 from ProcessMaker/bugfix/FOUR-33645
pmPaulis Oct 8, 2026
a7216fd
Merge pull request #8942 from ProcessMaker/feature/FOUR-32126
pmPaulis Oct 8, 2026
6d0d33f
feat(FOUR-30668): add API_FAST_TASK fast path for V1.1 task show
gproly Oct 9, 2026
a24306a
test(FOUR-30668): stabilize V1_1 PHPUnit timing and saved-search asse…
gproly Oct 13, 2026
30560c6
refactor(FOUR-30668): hydrate request data on fast task show only
gproly Oct 13, 2026
41ca5ed
chore(FOUR-30668): restore ProcessVariableControllerTest from develop
gproly Oct 13, 2026
89245de
chore(FOUR-30668): align DataManagerTest with develop
gproly Oct 13, 2026
d1b4ecb
Merge branch 'develop' into feature/FOUR-30668
gproly Oct 13, 2026
8376e37
refactor(FOUR-30668): rename fast task flag and align requestor on sh…
gproly Oct 15, 2026
e10bc8e
Merge branch 'develop' into feature/FOUR-30668
gproly Oct 15, 2026
462794b
FOUR-30918: phase 1 perfomance
pmPaulis Oct 19, 2026
3031089
FOUR-32144: Phase 3: Platform Performance
pmPaulis Oct 19, 2026
d80baef
Bumped version
pmPaulis Oct 19, 2026
458df49
test(FOUR-30668): relax showFast timing ratio default for CI
gproly Oct 19, 2026
de64f20
test(FOUR-30668): raise showFast timing ratio default to 0.66
gproly Oct 19, 2026
522c353
Pin FOUR-30918 JS branch prereleases and savedsearch dev branch.
nolanpro Oct 20, 2026
5b71be6
Version 2026.17.1-perf1
nolanpro Oct 20, 2026
de8d3e1
fixing version name
pmPaulis Oct 23, 2026
4b6f9ce
updating with develop
pmPaulis Oct 23, 2026
a4e5b13
fix(FOUR-34193): resolve V1.1 TaskController from the container on op…
rodriquelca Oct 28, 2026
5e154f9
test: add tests for EnsureAccountAllowsAccess middleware
devmiguelangel Oct 28, 2026
767a5d8
updating with 2026.16.4 and solving conflicts
pmPaulis Oct 28, 2026
02ba967
updating the version
pmPaulis Oct 28, 2026
f412a1c
fix: enhance EnsureAccountAllowsAccess middleware to accept dynamic g…
devmiguelangel Oct 28, 2026
b284103
feat: update ProcessMakerAuthenticate middleware to pass guards to En…
devmiguelangel Oct 28, 2026
29ba1da
test: enhance k6 ETag tests with configuration validation and dynamic…
devmiguelangel Oct 28, 2026
89cad74
Merge pull request #9115 from ProcessMaker/bugfix/FOUR-34193
pmPaulis Oct 28, 2026
096a6c6
solving conflicts
pmPaulis Oct 29, 2026
b9a7090
fix: avoid logout on stateless API guard
devmiguelangel Oct 29, 2026
2bcece4
updating with develop and conflicts
pmPaulis Nov 3, 2026
b28ad97
Merge remote-tracking branch 'origin/nightly/2026.17-perfomance' into…
pmPaulis Nov 3, 2026
d614531
Merge pull request #9117 from ProcessMaker/FOUR-34196
pmPaulis Nov 3, 2026
f429083
Merge remote-tracking branch 'origin/nightly/2026.17-perfomance' into…
pmPaulis Nov 4, 2026
8699979
Merge pull request #9097 from ProcessMaker/feature/FOUR-30668
pmPaulis Nov 4, 2026
4b7dcb1
Merge remote-tracking branch 'origin/develop' into nightly/2026.17-pe…
pmPaulis Nov 10, 2026
486e294
Fixing sonar observations
pmPaulis Nov 11, 2026
c0c9d24
fix: remove unnecessary preload links in the task edit view
devmiguelangel Nov 11, 2026
8ecfb29
fix(FOUR-34369): eager-load processRequest.process in optimized index…
gproly Nov 11, 2026
49c3be3
fix(FOUR-34369): index tasks and requests after raw token persistence
gproly Nov 11, 2026
9ef26c3
fix(FOUR-34369): select correct columns for optimized draft eager load
gproly Nov 11, 2026
6584874
Merge pull request #9156 from ProcessMaker/FOUR-34366
pmPaulis Nov 11, 2026
fbecbcb
fix(FOUR-34369): authorize v1.1 task completion before closed check
gproly Nov 11, 2026
a78a842
chore(FOUR-34369): align composer.json with develop
gproly Nov 11, 2026
d9f56e2
refactor(FOUR-34369): lower cognitive complexity of optimized index e…
gproly Nov 11, 2026
c9dc497
Merge remote-tracking branch 'origin/nightly/2026.17-perfomance' into…
pmPaulis Nov 12, 2026
ff0de0b
Fixing sonar observations
pmPaulis Nov 12, 2026
d19a15e
Merge branch 'nightly/2026.17-perfomance' into bugfix/FOUR-34369
gproly Nov 12, 2026
257a64c
fix(FOUR-34369): hide draft payload on task index without view permis…
gproly Nov 12, 2026
d618f49
fix(FOUR-34369): hide draft payload on task index without view permis…
gproly Nov 12, 2026
dd5188d
fix(FOUR-34369): hydrate token for draft view policy on partial proje…
gproly Nov 12, 2026
51641b4
fix(FOUR-34369): gate draft data on task index and fix manager checks
gproly Nov 12, 2026
752fb97
fix(FOUR-34369): align draft manager gate with loose id comparison
gproly Nov 12, 2026
90d2d07
fix(FOUR-34369): resolve process managers without serializing properties
gproly Nov 12, 2026
1df22bc
fix(FOUR-34369): align v1.1 task show include parsing with draft gates
gproly Nov 12, 2026
c9b1721
fix(FOUR-34369): add TaskDraftIncludes support class for task draft g…
gproly Nov 12, 2026
e269213
Merge pull request #9154 from ProcessMaker/FOUR-34368
pmPaulis Nov 12, 2026
4c10273
Merge branch 'nightly/2026.17-perfomance' into bugfix/FOUR-34369
gproly Nov 12, 2026
36a628b
fix(FOUR-34369): match draft includes by path segment not substring
gproly Nov 12, 2026
fb8ffaf
fix(FOUR-34369): redact task draft whenever the relation is loaded
gproly Nov 12, 2026
35b1f64
fix(FOUR-34369): bind draft policy to persisted tokens on v1.1 show
gproly Nov 12, 2026
96bafa5
fix(FOUR-34369): harden task draft includes on index and show
gproly Nov 12, 2026
736bbb4
fix(FOUR-34369): treat draft include paths case-insensitively
gproly Nov 12, 2026
d8d53ac
refactor(FOUR-34369): reduce return count in draft payload helpers
gproly Nov 12, 2026
b64d057
fix(FOUR-34369): coerce null process index pmql query to empty string
gproly Nov 12, 2026
196fc51
fixing conflicts
pmPaulis Nov 12, 2026
1e891d0
refactor(FOUR-34369): reduce return statements in resolveDraftPayload…
gproly Nov 13, 2026
02ee320
Merge branch 'nightly/2026.17-perfomance' into bugfix/FOUR-34369
gproly Nov 13, 2026
f2f36bf
fix(FOUR-34369): scope root draft sanitization and eager load to root…
gproly Nov 13, 2026
982f6bc
fix(FOUR-34369): treat Laravel include column suffixes in draft token…
gproly Nov 13, 2026
89b0636
fix(FOUR-34369): only consume task drafts on root include when drafts…
gproly Nov 13, 2026
365fd5f
test(FOUR-34369): assert nested draft include does not delete assigne…
gproly Nov 13, 2026
4ed37b4
perf(FOUR-34369): batch draft policy token loads on include=draft
gproly Nov 13, 2026
6a7f7f2
fix(FOUR-34369): trust DB for nested draft policy and limit consume t…
gproly Nov 13, 2026
f43c706
fix(tasks): pass managed visibility flag in optimized index
gproly Nov 13, 2026
7c3ec3f
Merge pull request #9157 from ProcessMaker/bugfix/FOUR-34369
pmPaulis Nov 13, 2026
d2400f2
Merge branch 'develop' into nightly/2026.17-perfomance
gproly Nov 13, 2026
85c0dc9
fix(security): disarm raw close timers and restore no-store when ETag…
gproly Nov 13, 2026
8048227
fix(security): disarm raw close timers and align BrowserCache with ETags
gproly Nov 13, 2026
fda81db
fix(tasks): preserve eager-loaded draft nested includes
gproly Nov 13, 2026
e12f7ed
fix(sonar): reduce returns in taskDraftForToken
nolanpro Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 87 additions & 81 deletions ProcessMaker/Http/Controllers/Api/ProcessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use ProcessMaker\Models\Screen;
use ProcessMaker\Models\Script;
use ProcessMaker\Models\Template;
use ProcessMaker\Models\User;
use ProcessMaker\Nayra\Exceptions\ElementNotFoundException;
use ProcessMaker\Nayra\Services\FixBpmnSchemaService;
use ProcessMaker\Nayra\Storage\BpmnDocument;
Expand Down Expand Up @@ -129,41 +130,23 @@ public function index(Request $request)
$user = Auth::user();

$orderBy = $this->getRequestSortBy($request, 'name');
if (!str_contains($orderBy[0], '.')) {
$orderBy[0] = 'processes.' . $orderBy[0];
}
$perPage = $this->getPerPage($request);
$include = $this->getRequestInclude($request);
$status = $request->input('status');
$pmql = $request->input('pmql', '');
$relationships = array_values(array_diff($include, ['events']));

$processes = Process::nonSystem()->notArchived()->with($include);
if ($status === 'archived') {
$processes = Process::archived()->with($include);
}
if ($status === 'all') {
$processes = Process::active()->with($include);
}
$processes = $this->buildProcessIndexQuery($request->input('status'), $relationships);

$filter = $request->input('filter', '');
if (!empty($filter)) {
$processes->filter($filter);
}

// The simplified parameter indicates to return just the main information of processes
if ($request->input('simplified_data', false)) {
$processes = Process::where('status', 'ACTIVE')->select('id', 'start_events')->get();
$modifiedCollection = $processes->map(function ($item) {
return [
'id' => $item['id'],
'events' => $item['start_events']];
});

return new ApiCollection($modifiedCollection);
}

if ($request->input('simplified_data_for_selector', false)) {
$fields = $this->getRequestFields($request);
$processes = $processes->select($fields);

return new ApiCollection($processes->get());
$simplifiedResponse = $this->processIndexSimplifiedResponse($request, $processes);
if ($simplifiedResponse !== null) {
return $simplifiedResponse;
}

// Filter by category
Expand All @@ -175,76 +158,99 @@ public function index(Request $request)
// Filter by category status
$processes->categoryStatus($request->input('cat_status', null));

if (!empty($pmql)) {
try {
$processes->pmql($pmql);
} catch (\ProcessMaker\Query\SyntaxError $e) {
return response(['error' => 'PMQL error'], 400);
}
$pmqlError = $this->applyProcessIndexPmql($processes, (string) ($request->input('pmql') ?? ''));
if ($pmqlError !== null) {
return $pmqlError;
}

// Get with bookmark
$bookmark = $request->input('bookmark', false);
// Get with launchpad
$launchpad = $request->input('launchpad', false);

$processes = $processes->with('events')
->select('processes.*')
$processes = $processes
->with('notification_settings')
->exclude(['bpmn', 'svg'])
->leftJoin(\DB::raw('(select id, uuid, name from process_categories) as category'), 'processes.process_category_id', '=', 'category.id')
->leftJoin(\DB::raw('(select id, uuid, username, lastname, firstname from users) as user'), 'processes.user_id', '=', 'user.id')
->orderBy(...$orderBy)
->get()
->collect();
->paginate($perPage);

foreach ($processes as $key => $process) {
// filter the start events that can be used manually (no timer start events);
// TODO: startEvents is not a real property on Process.
// Move below to $process->getManualStartEvents();
$process->startEvents = $process->events->filter(function ($event) {
$eventIsTimerStart = collect($event['eventDefinitions'])
->filter(function ($eventDefinition) {
return $eventDefinition['$type'] == 'timerEventDefinition';
})->count() > 0;
$this->enrichProcessIndexCollection(
$processes,
$user,
$request->input('bookmark', false),
$request->input('launchpad', false)
);

// Filter out web entry start events and email start events
$eventIsWebEntry = false;
$eventIsEmailStart = false;
if (isset($event['config'])) {
$config = json_decode($event['config'], true);
if (isset($config['web_entry']) && $config['web_entry'] !== null) {
$eventIsWebEntry = true;
} elseif (isset($config['email_start']) && $config['email_start'] !== null) {
$eventIsEmailStart = true;
}
}
return new ProcessCollection($processes);
}

return !$eventIsTimerStart && !$eventIsWebEntry && !$eventIsEmailStart;
})->values();
private function buildProcessIndexQuery(?string $status, array $relationships)
{
$processes = Process::nonSystem()->notArchived()->with($relationships);
if ($status === 'archived') {
return Process::archived()->with($relationships);
}
if ($status === 'all') {
return Process::active()->with($relationships);
}

return $processes;
}

private function processIndexSimplifiedResponse(Request $request, $processes)
{
if ($request->input('simplified_data', false)) {
$items = Process::where('status', 'ACTIVE')->select('id', 'start_events')->get();
$modifiedCollection = $items->map(function ($item) {
return [
'id' => $item['id'],
'events' => $item['start_events'],
];
});

// Get the id bookmark related
$process->bookmark_id = Bookmark::getBookmarked($bookmark, $process->id, $user->id);
// Get the launchpad configuration
$process->launchpad = ProcessLaunchpad::getLaunchpad($launchpad, $process->id);
return new ApiCollection($modifiedCollection);
}

if ($request->input('simplified_data_for_selector', false)) {
$fields = $this->getRequestFields($request);
$processes = $processes->select($fields);

return new ApiCollection($processes->get());
}

return null;
}

private function applyProcessIndexPmql($processes, string $pmql)
{
if (empty($pmql)) {
return null;
}

try {
$processes->pmql($pmql);
} catch (\ProcessMaker\Query\SyntaxError $e) {
return response(['error' => 'PMQL error'], 400);
}

return null;
}

private function enrichProcessIndexCollection($processes, User $user, $bookmark, $launchpad): void
{
foreach ($processes as $process) {
$process->setAppends(array_values(array_diff($process->getAppends(), ['projects'])));
$process->makeHidden('notification_settings');

$process->bookmark_id = $bookmark
? Bookmark::getBookmarked($bookmark, $process->id, $user->id)
: 0;
$process->launchpad = $launchpad
? ProcessLaunchpad::getLaunchpad($launchpad, $process->id)
: null;
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

$process->case_retention_tier_adjustment_notice = false;
if ($user->is_administrator && config('app.case_retention_policy_enabled')) {
$process->case_retention_tier_adjustment_notice = CaseRetentionTierService::adjustmentNoticeIsActive($process);
}

// Filter all processes that have event definitions (start events like message event, conditional event, signal event, timer event)
if ($request->has('without_event_definitions') && $request->input('without_event_definitions') == 'true') {
$startEvents = $process->events->filter(function ($event) {
return collect($event['eventDefinitions'])->isEmpty();
});
}

// filter only valid executable processes
if (!$process->isValidForExecution()) {
$processes->startEvents = [];
}
}

return new ProcessCollection($processes);
}

/**
Expand Down
Loading
Loading