Skip to content

FOUR-32144: [EPIC] Phase 3: Platform Performance Tentpole Project - #9094

Open
pmPaulis wants to merge 23 commits into
developfrom
epic/FOUR-32144
Open

pmPaulis wants to merge 23 commits into
developfrom
epic/FOUR-32144

Conversation

@pmPaulis

@pmPaulis pmPaulis commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Phase 3: Platform Performance Tentpole Project

Improve the following

  • Get Process
  • Get Requests
  • PUT Task
  • Inbox Loading

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

ci:deploy

rodriquelca and others added 21 commits July 28, 2026 11:03
Introduce PUT /api/1.1/tasks/{id} for COMPLETED status, gated by
TASK_UPDATE_V1_1_ENABLED, with optional raw token persistence behind
TOKEN_PERSISTENCE_RAW_ENABLED.

https://processmaker.atlassian.net/browse/FOUR-32800
Batch-load listing relations after pagination to avoid per-row queries
for process version alternative, active tasks, process categories, and
project assets while preserving the existing API response shape.

- Add ProcessRequestListingRawRepository to hydrate activeTasks (raw SQL)
  and process data (Eloquent + batched projects/categories)
- Use withAggregate for process_version_alternative and read it without
  lazy-loading ProcessVersion
- Add activeTasks relation and use preloaded data in ProcessRequests
- Preload projects JSON and reuse loaded categories in Process accessors
- Apply hydration in index and getRequestsByCase
- Add bounded query-count feature test

https://processmaker.atlassian.net/browse/FOUR-32947
feat(FOUR-32801): improve Jobs execution when the PUT tasks endpoint is executed
feat(FOUR-32800): add v1.1 task completion endpoint with raw SQL path
FOUR-32800: test compares legacy and optimized
…mps are null

Prevent task completion failures when recording the Prometheus
activity_execution_time_seconds histogram in BpmnSubscriber.

Fall back to created_at and completed_at when created_at_ms or
completed_at_ms are unavailable, and skip the metric observation
when either timestamp is still missing.

https://processmaker.atlassian.net/browse/FOUR-33645
FOUR-32144: Improve the api PUT /api/1.0/tasks/{task-id}
FOUR-32946 Improve the API /api/1.0/processes
perf(FOUR-32947): reduce N+1 queries on requests listing (FOUR-32947)
@cursor

cursor Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
Touches core BPMN persistence, task completion authorization, and list API payloads (including removed process startEvents shaping); raw paths alter how request/token data is written when feature flags are enabled.

Overview
This PR is Phase 3 performance work for process/request listings, task completion, and inbox load time. Most behavior changes are query-shape and serialization optimizations; optional raw SQL paths are gated by new config flags (defaults off).

Process list (GET /api/processes) now paginates in SQL instead of loading all rows, drops heavy columns (bpmn, svg), batches notification_settings for the current page, and only runs bookmark/launchpad lookups when those query params are set. Sorting qualifies bare column names with processes.. The designer client no longer requests with=events; per-row startEvents filtering and related post-processing were removed from the controller loop.

Process request listings avoid N+1 includes via ProcessRequestListingRawRepository (bulk activeTasks and process, including projects JSON when needed), skip default eager process when include=process, and use withAggregate for process_version_alternative. ProcessRequests uses a preloaded activeTasks relation when present.

Task completion adds PUT /api/1.1/tasks/{id} (completion only) behind TASK_UPDATE_V1_1_ENABLED, using raw reads and TaskCompletionEngineBridge to call the BPMN engine. TOKEN_PERSISTENCE_RAW_ENABLED switches token/instance persistence in TokenRepository / ExecutionInstanceRepository to TokenPersistenceRawRepository updates instead of full Eloquent saves.

Smaller changes: GenerateUserRecommendations is unique per user for 60s; Scout wasSearchableBefore* hooks skip remove/index jobs when indexed search is off; activity metrics fall back when *_ms timestamps are missing; login page prefetches main inbox JS bundles.

Reviewed by Cursor Bugbot for commit a7216fd. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.


$this->runUpdate('process_request_tokens', $tokenId, $payload);
$token->syncChanges();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raw persistence skips model observers

High Severity

When token_persistence_raw_enabled is on, token and request updates go through raw UPDATEs and never call Eloquent save(). That skips ProcessRequestObserver and ProcessRequestTokenObserver, so case titles are not recalculated on data changes, scheduled timers are not deleted when a token closes, and saveVersion() / completed_at_ms never run.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c1e2d66. Configure here.

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://tenant-1.ci-63382c5fab.engk8s.processmaker.net

fix(FOUR-33645): guard activity execution time metric when ms timesta…
FOUR-32126: Inbox >> First loading is to slow
@decisions-sonarqube

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a7216fd. Configure here.

<link rel="prefetch" href="{{ mix('js/bootstrap-vendor.js') }}" as="script">
<link rel="prefetch" href="{{ mix('js/fortawesome-vendor.js') }}" as="script">
<link rel="prefetch" href="{{ mix('js/app.js') }}" as="script">
<link rel="prefetch" href="{{ mix('js/app-layout.js') }}" as="script">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Login Mix prefetch misses inbox

Medium Severity

The Vite login view now calls mix() for six webpack bundles. Inbox already boots from layoutnextvite and @vite (loaderTasks.js / tasks.js), so those Mix files are unused after login. mix() also throws when mix-manifest.json is missing, so /login can 500 even when Vite assets are built.

Fix in Cursor Fix in Web

Triggered by learned rule: Full Mix-to-Vite route cutover

Reviewed by Cursor Bugbot for commit a7216fd. Configure here.

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://tenant-1.ci-63382c5fab.engk8s.processmaker.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants