Repository navigation
Conversation
RomainLvr
marked this pull request as ready for review
November 25, 2026 10:57
RomainLvr
requested review from
a team,
Herafia,
Rom1-B and
jdurand-teclib
and removed request for
a team
November 25, 2026 10:57
jdurand-teclib
requested changes
Nov 26, 2026
jdurand-teclib
left a comment
There was a problem hiding this comment.
#55 has some changes that might be in conflict with those made here (See reviews)
See suggestions to avoid issues after the rebase.
It might be worth making a functionnal check after rebasing and solving the conflicts to ensure everything is ok, tho.
| $PLUGIN_HOOKS['csrf_compliant']['jamf'] = true; | ||
|
|
||
| if (Plugin::isPluginActive('jamf')) { | ||
| $PLUGIN_HOOKS['add_javascript']['jamf'][] = 'js/jamf.js'; |
There was a problem hiding this comment.
#55 Makes js/jamf.js holding all click handlers. Suppressing this hook might disable buttons effects all over the plugin, once the changes will be rebased.
|
|
||
| - Fix `migration:unsigned_keys` failure on `glpi_plugin_jamf_devices.jamf_items_id` (negative default value) | ||
| - Fix main tab of Jamf-linked computers and phones crashing when Twig strict variables are enabled | ||
| - Fix SQL queries and page weight added by the plugin: no plugin state check on every request, index on mobile devices, lighter merge page, `jamf.js` only loaded on the MDM commands tab |
There was a problem hiding this comment.
If you restore the ADD_JAVASCRIPT hook, this statement is not true anymore.
Suggested change
| - Fix SQL queries and page weight added by the plugin: no plugin state check on every request, index on mobile devices, lighter merge page, `jamf.js` only loaded on the MDM commands tab | |
| - Fix SQL queries and page weight added by the plugin: no plugin state check on every request, index on mobile devices, lighter merge page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist before requesting a review
Description
A benchmark on a seeded database (4 000 assets, 3 900 Jamf devices, 50 000 extension attribute values, 50 000 pending imports) showed several avoidable costs added by the plugin to every GLPI request and to its own pages. It also showed a crash on the main tab of Jamf-linked assets when Twig strict variables are enabled (dev and test environments):
Fix
setup.php: remove thePlugin::isPluginActive('jamf')check fromplugin_init_jamf(). GLPI already calls the init only for active plugins, and the check readglpi_pluginstwice on every HTTP request, AJAX calls included.inc/migration.class.php: add an index onglpi_plugin_jamf_mobiledevices.glpi_plugin_jamf_devices_idin the 3.2.4 migration. The join done on every Phone form scanned the whole table.front/merge.php/merge.html.twig: hide the already linked items with a dropdowncondition(subquery) instead of an inlineusedlist of every linked id in each row. The page no longer reads the whole devices table.inc/abstractdevice.class.php: cachegetJamfItemClassForGLPIItem()per request (it runs once per tab name and once for the information block). The cache entry is cleared when the item is purged.inc/connection.class.php: add a connect timeout (5 s) and a total timeout (30 s) to the Jamf API calls (Guzzle client and token requests). The MDM commands tab calls the API while it renders, and a slow Jamf server could block the page and the PHP worker.js/jamf.jsis now loaded only by the MDM commands tab instead of every GLPI page.inventory_info.html.twig: testbutton.url is definedto fix the crash above.Results
Display times did not change significantly at these volumes. The gains grow with the size of the fleet.
Notes