|
50973
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50973
|
|
50978
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Close tab
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50978
|
|
50979
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Close tab
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50979
|
|
50985
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50985
|
|
50986
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50986
|
|
50987
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be
null
in your database schema, the tool will crash with a "Call to a member function on null" error:
Missing Team:
$team = $user->team;
is directly followed by
$team->getUuid()
. If a user is not currently assigned to a team, this will trigger a fatal error.
Missing Timezone:
$user->getTimezone()->getName()
assumes
getTimezone()
always returns an object. If it can return
null
, chaining
->getName()
will crash.
Language Fallback:
If
$languageDialects
is empty and the user lacks a team, the fallback logic
... ?? $team->getDefaultLanguage() ?? 'en'
will fail because
$team
is
null
.
3. Collection to Array Serialization
3. Collection to Array Serialization
The Risk:
When using
$languageDialects->map(...)->toArray()...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50987
|
|
50988
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be
null
in your database schema, the tool will crash with a "Call to a member function on null" error:
Missing Team:
$team = $user->team;
is directly followed by
$team->getUuid()
. If a user is not currently assigned to a team, this will trigger a fatal error.
Missing Timezone:
$user->getTimezone()->getName()
assumes
getTimezone()
always returns an object. If it can return
null
, chaining
->getName()
will crash.
Language Fallback:
If
$languageDialects
is empty and the user lacks a team, the fallback logic
... ?? $team->getDefaultLanguage() ?? 'en'
will fail because
$team
is
null
.
3. Collection to Array Serialization
3. Collection to Array Serialization
The Risk:
When using
$languageDialects->map(...)->toArray()
, Laravel collections sometimes preserve their underlying associative keys.
The Impact:
Instead of generating a clean JSON array (e.g.,
["en_GB", "bg_BG"]
), it might generate a JSON object with numeric string keys (e.g.,
{"0": "en_GB", "1": "bg_BG"}
). This would violate your schema's strict definition of
->items($schema->string())
.
The Fix:
Append
->values()...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50988
|
|
50989
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions....
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50989
|
|
50990
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions....
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes#diff-de5 github.com/jiminny/app/pull/12090/changes#diff-de56bda8bf0f864da47b3884a4348a6b03ac702233ea714aa0d278edd2db2c20...
|
50990
|
|
50961
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be
null
in your database schema, the tool will crash with a "Call to a member function on null" error:
Missing Team:
$team = $user->team;
is directly followed by
$team->getUuid()
. If a user is not currently assigned to a team, this will trigger a fatal error.
Missing Timezone:
$user->getTimezone()->getName()
assumes
getTimezone()
always returns an object. If it can return
null
, chaining
->getName()
will crash.
Language Fallback:
If
$languageDialects
is empty and the user lacks a team, the fallback logic
... ?? $team->getDefaultLanguage() ?? 'en'
will fail because
$team
is
null
.
3. Collection to Array Serialization
3. Collection to Array Serialization
The Risk:
When using
$languageDialects->map(...)->toArray()
, Laravel collections sometimes preserve their underlying associative keys.
The Impact:
Instead of generating a clean JSON array (e.g.,
["en_GB", "bg_BG"]
), it might generate a JSON object with numeric string keys (e.g.,
{"0": "en_GB", "1": "bg_BG"}
). This would violate your schema's strict definition of
->items($schema->string())
.
The Fix:
Append
->values()
before
->toArray()
to guarantee a sequentially indexed array:
PHP
Download code
Copy code
$languageDialects
->map(
fn
(
$dialect
) => $
dialect
->
getLanguageLocale
(
))->
values
(
)->
toArray
(
)
Are any of these properties (like
$team
or
$timezone...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes
|
50961
|
|
51071
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
pipedrive offical SDK v2 POC #12090 Edit title
pipedrive offical SDK v2 POC
#
12090
Edit title
Preview
Preview
Not ready
Not ready
Code
Code
Draft
LakyLak
LakyLak
wants to merge 1 commit into
master
master
from
pipedrive-sdk-poc
pipedrive-sdk-poc
Copy head branch name to clipboard
Lines changed: 1101 additions & 1 deletion
Conversation (0)
Conversation
(
0
)
Commits (1)
Commits
(
1
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Pull Request Toolbar
Pull Request Toolbar
Collapse file tree
All commits
All commits
0 of 6 files viewed
Submit review
Submit
review
Open diff view settings
Open overview panel
Open comments panel
(
0
)
Filter files…
Filter options
File tree
File tree
app/Console
Commands/Crm
TestPipedriveOfficialSdkCommand.php
TestPipedriveOfficialSdkCommand.php
Kernel.php
Kernel.php
composer.json
composer.json
composer.lock
composer.lock
PIPEDRIVE_V2_MIGRATION_PLAN.md
PIPEDRIVE_V2_MIGRATION_PLAN.md
PIPEDRIVE_V2_MIGRATION_TICKETS.md
PIPEDRIVE_V2_MIGRATION_TICKETS.md
Collapse file
app/Console/Commands/Crm/TestPipedriveOfficialSdkCommand.php
app/Console/Commands/Crm/TestPipedriveOfficialSdkCommand.php
app/Console/Commands/Crm/TestPipedriveOfficialSdkCommand.php
Copy file name to clipboard
Lines changed: 540 additions & 0 deletions
Not Viewed
Viewed
Comment on this file
More options
Original file line number
Original file line
Diff line number
Diff line change
@@ -0,0 +1,540 @@
1
+
<?php
2
+
3
+
declare
(strict_types=
1
);
4
+
5
+
namespace
Jiminny
\
Console
\
Commands
\
Crm
;
6
+
7
+
use
Carbon
\
Carbon
;
8
+
use
Exception
;
9
+...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090/changes
|
51071
|
|
50958
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be
null
in your database schema, the tool will crash with a "Call to a member function on null" error:
Missing Team:
$team = $user->team;
is directly followed by
$team->getUuid()
. If a user is not currently assigned to a team, this will trigger a fatal error.
Missing Timezone:
$user->getTimezone()->getName()
assumes
getTimezone()
always returns an object. If it can return
null
, chaining
->getName()
will crash.
Language Fallback:
If
$languageDialects
is empty and the user lacks a team, the fallback logic
... ?? $team->getDefaultLanguage() ?? 'en'
will fail because
$team
is
null
.
3. Collection to Array Serialization
3. Collection to Array Serialization
The Risk:
When using
$languageDialects->map(...)->toArray()
, Laravel collections sometimes preserve their underlying associative keys.
The Impact:
Instead of generating a clean JSON array (e.g.,
["en_GB", "bg_BG"]
), it might generate a JSON object with numeric string keys (e.g.,
{"0": "en_GB", "1": "bg_BG"}
). This would violate your schema's strict definition of
->items($schema->string())
.
The Fix:
Append
->values()
before
->toArray()
to guarantee a sequentially indexed array:
PHP
Download code
Copy code
$languageDialects
->map(
fn
(
$dialect
) => $
dialect
->
getLanguageLocale
(
))->
values
(
)->
toArray
(
)
Are any of these properties (like
$team
or
$timezone
) guaranteed to be non-null at the database level, or should we look at adding nullable fallbacks in the output payload?
Good response
Bad response
Redo
Share & export
Copy
Show more options
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
Send message
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
50958
|
|
50959
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be
null...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
50959
|
|
50960
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
50960
|
|
51034
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
51034
|
|
51035
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be
null
in your database schema, the tool will crash with a "Call to a member function on null" error:
Missing Team:
$team = $user->team;
is directly followed by
$team->getUuid()
. If a user is not currently assigned to a team, this will trigger a fatal error.
Missing Timezone:
$user->getTimezone()->getName()
assumes
getTimezone()
always returns an object. If it can return
null
, chaining
->getName()
will crash.
Language Fallback:
If
$languageDialects
is empty and the user lacks a team, the fallback logic
... ?? $team->getDefaultLanguage() ?? 'en'
will fail because
$team
is
null
.
3. Collection to Array Serialization
3. Collection to Array Serialization
The Risk:
When using
$languageDialects->map(...)->toArray()
, Laravel collections sometimes preserve their underlying associative keys.
The Impact:
Instead of generating a clean JSON array (e.g.,
["en_GB", "bg_BG"]
), it might generate a JSON object with numeric string keys (e.g.,
{"0": "en_GB", "1": "bg_BG"}
). This would violate your schema's strict definition of
->items($schema->string())
.
The Fix:
Append
->values()
before
->toArray()
to guarantee a sequentially indexed array:
PHP
Download code
Copy code
$languageDialects
->map(
fn
(
$dialect
) => $
dialect
->
getLanguageLocale
(
))->
values
(
)->
toArray
(
)
Are any of these properties (like
$team
or
$timezone
) guaranteed to be non-null at the database level, or should we look at adding nullable fallbacks in the output payload?
Good response
Bad response
Redo
Share & export...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
51035
|
|
51036
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20846 mcp enable the ai to know details about t</tabTitle>” with “<selection>@@ -0,0 +1,157 @@1+ $schema->string()35+ ->description(36+'UUID of the authenticated user. Use this as the authoritative identifier when filtering calls or deals by '37+ . 'the current user.'38+ )39+ ->required(),40+'name' => $schema->string()41+ ->description('Full display name of the user, e.g. \'John Doe\'.')42+ ->required(),43+'first_name' => $schema->string()44+ ->description(45+'First name of the user, derived from the full name field. Use for personalised greetings or addressing '46+ . 'the user directly.'47+ )48+ ->required(),49+'email' => $schema->string()50+ ->description('Primary email address of the user.')51+ ->required(),52+'timezone' => $schema->string()53+ ->description(54+'The user\'s timezone as an IANA timezone identifier, e.g. \'America/New_York\'. Use this when displaying '55+ . 'or reasoning about call times in the user\'s local time.'56+ )57+ ->required(),58+'spoken_languages' => $schema->array()59+ ->items($schema->string())60+ ->description(61+'Languages spoken during this user\'s calls, as an array of locale codes, e.g. [\'en_GB\', \'bg_BG\']. '62+ . 'The first entry is the primary/default language — used when language detection is unavailable. '63+ . 'Additional entries are other languages the user handles.'64+ )65+ ->required(),66+'sync_dialer' => $schema->boolean()67+ ->description(68+'True if the user has automatic syncing of softphone and outbound calls to their CRM enabled. When true, '69+ . 'calls made through the Jiminny dialler are automatically logged as CRM activities.'70+ )71+ ->required(),72+'sync_email' => $schema->boolean()73+ ->description(74+'True if the user has email syncing enabled. When true, customer email conversations are captured as '75+ . 'activities.'76+ )77+ ->required(),78+'sync_calendar' => $schema->boolean()79+ ->description(80+'True if the user has calendar syncing enabled. When true, scheduled meetings will be automatically '81+ . 'recorded.'82+ )83+ ->required(),84+'team' => $schema->object([85+'id' => $schema->string()86+ ->description(87+'Team UUID. Use this when filtering calls or deals by the user\'s team in search_calls or '88+ . 'search_deals.'89+ )90+ ->required(),91+'name' => $schema->string()92+ ->description('Team name, e.g. \'Account Executives\', \'Customer Success\'.')93+ ->required(),94+'playbook' => $schema->string()95+ ->description(96+'Name of the active playbook assigned to this team, e.g. \'Sales\', \'Customer Success\'. A playbook '97+ . 'defines the call evaluation criteria used for AI scoring. Null if no playbook is assigned.'98+ )99+ ->nullable()100+ ->required(),101+ ])102+ ->description('The team this user belongs to.')103+ ->required(),104+'job' => $schema->string()105+ ->description(106+'The user\'s job title, e.g. \'Software Engineer\', \'Account Executive\', \'Sales Manager\'. Null if no '107+ . 'job title has been assigned.'108+ )109+ ->nullable()110+ ->required(),111+'roles' => $schema->array()112+ ->items($schema->string())113+ ->description(114+'Roles assigned to the user, e.g. [\'admin\', \'recorder_and_voice\']. Determines what the user can do in '115+ . 'the platform. Common values: \'admin\' (full organisation admin), \'manager\' (team manager with '116+ . 'coaching access), \'recorder_and_voice\' (can record meetings and make calls), \'recorder\' (recording only).'117+ )118+ ->required(),119+ ];120+ }121+122+public function handle(Request $request): ResponseFactory123+ {124+$user = $request->user();125+assert($user instanceof User, 'auth:api + McpTierMiddleware must guarantee an authenticated User before the tool runs');126+127+$team = $user->team;128+$roles = $user->getRoles();129+$jobTitle = $user->job;130+131+$languageDialects = $user->languageDialects()->with('language')->get();132+$spokenLanguages = $languageDialects->isNotEmpty()133+ ? $languageDialects->map(fn ($dialect) => $dialect->getLanguageLocale())->toArray()134+ : [$user->getLanguage() ?? $team->getDefaultLanguage() ?? 'en'];135+136+$payload = [137+'id' => $user->getUuid(),138+'name' => $user->getName(),139+'first_name' => $user->getFirstName(),140+'email' => $user->getEmailAddress(),141+'timezone' => $user->getTimezone()->getName(),142+'spoken_languages' => $spokenLanguages,143+'sync_dialer' => $user->shouldSyncDialer(),144+'sync_email' => $user->isSyncEmailEnabled(),145+'sync_calendar' => $user->isSyncConferenceEnabled(),146+'team' => [147+'id' => $team->getUuid(),148+'name' => $team->getName(),149+'playbook' => $team->getDefaultPlaybook()?->getName(),150+ ],151+'job' => $jobTitle?->getName(),152+'roles' => $roles,153+ ];154+155+return Response::structured($payload);156+ }157+}</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Code Summary: MCP "Get User Details" Tool Implementation
Code Summary: MCP "Get User Details" Tool Implementation
This code snippet defines the schema and execution logic for a Model Context Protocol (MCP) tool that exposes the authenticated user's profile details to an AI assistant.
Schema Definition
Schema Definition
The tool outputs a structured object containing the following required fields to guide the AI's contextual understanding and filtering capabilities:
User Identity:
*
id
: UUID used as the authoritative identifier for filtering calls or deals.
name
: Full display name (e.g., 'John Doe').
first_name
: Extracted first name, explicitly intended for personalized greetings.
email
: Primary email address.
job
: Job title (e.g., 'Account Executive'); nullable.
Preferences & Context:
timezone
: IANA identifier (e.g., 'America/New_York') for reasoning about local call times.
spoken_languages
: An array of locale codes. The first entry serves as the primary/default language.
roles
: Platform permissions determining capabilities (e.g.,
admin
,
manager
,
recorder_and_voice
).
Sync Settings:
Booleans indicating whether the user has automated CRM syncing enabled for:
sync_dialer
(Jiminny softphone calls)
sync_email
(Customer email conversations)
sync_calendar
(Scheduled meetings)
Team Context:
An object containing the team's
id
,
name
, and
playbook
(the active AI scoring criteria; nullable).
Execution Logic (handle)
Execution Logic (
handle
)
The request handler extracts data from the authenticated
User
model and transforms it into the structured schema format:
Authentication Guard:
Assures via an assertion that an authenticated
User
instance is present before running.
Language Fallback:
Collects the user's configured language dialects. If none are explicitly set, it falls back to the user's default language, the team's default language, or
'en'
as a last resort.
Payload Output:
Maps the internal Laravel model getter methods (e.g.,
getUuid()
,
shouldSyncDialer()
,
getDefaultPlaybook()
) into the predefined
$payload
array and returns a structured JSON-like response.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issues?
You said
any potential issues?
Listen
Show thinking
Gemini said
Gemini said
Here is an assessment of the potential issues and edge cases in the provided code snippet:
1. Reliance on assert() in Production
1. Reliance on
assert()
in Production
The Risk:
PHP assertions (
assert(...)
) can be completely bypassed or ignored in production environments depending on the
zend.assertions
configuration in
php.ini
.
The Impact:
If the middleware fails to guarantee an authenticated user and assertions are disabled, the code will proceed. It will then throw a fatal error when attempting to call methods like
$user->team
on
null
.
The Fix:
Use a hard exception or early return instead:
PHP
Download code
Copy code
if
(!
$user
instanceof
User) {
throw
new
AuthenticationException(
'User must be authenticated.'
);
}
2. Potential Null Reference Exceptions
2. Potential Null Reference Exceptions
The code assumes certain relationships and properties will always exist on the
$user
object. If any of these can be
null
in your database schema, the tool will crash with a "Call to a member function on null" error:
Missing Team:
$team = $user->team;
is directly followed by
$team->getUuid()
. If a user is not currently assigned to a team, this will trigger a fatal error.
Missing Timezone:
$user->getTimezone()->getName()
assumes
getTimezone()
always returns an object. If it can return
null
, chaining
->getName()
will crash.
Language Fallback:
If
$languageDialects
is empty and the user lacks a team, the fallback logic
... ?? $team->getDefaultLanguage() ?? 'en'
will fail because
$team
is
null
.
3. Collection to Array Serialization
3. Collection to Array Serialization
The Risk:
When using
$languageDialects->map(...)->toArray()
, Laravel collections sometimes preserve their underlying associative keys.
The Impact:
Instead of generating a clean JSON array (e.g.,
["en_GB", "bg_BG"]
), it might generate a JSON object with numeric string keys (e.g.,
{"0": "en_GB", "1": "bg_BG"}
). This would violate your schema's strict definition of
->items($schema->string())
.
The Fix:
Append
->values()
before
->toArray()
to guarantee a sequentially indexed array:
PHP
Download code
Copy code
$languageDialects
->map(
fn
(
$dialect
) => $
dialect
->
getLanguageLocale
(
))->
values
(
)->
toArray
(
)
Are any of these properties (like
$team
or
$timezone
) guaranteed to be non-null at the database level, or should we look at adding nullable fallbacks in the output payload?
Good response
Bad response...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
51036
|
|
51069
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
pipedrive offical SDK v2 POC #12090 Edit title
pipedrive offical SDK v2 POC
#
12090
Edit title
View statusView status
Loading
Loading merge status
Code
Code
Draft
LakyLak
LakyLak
wants to merge 1 commit into
master
master
from
pipedrive-sdk-poc
pipedrive-sdk-poc
Copy head branch name to clipboard
Lines changed: 1101 additions & 1 deletion
Conversation (0)
Conversation
(
0
)
Commits (1)
Commits
(
1
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Conversation
Conversation
@LakyLak
Show options
LakyLak commented 4 minutes ago
LakyLak
LakyLak
commented
4 minutes ago
4 minutes ago
Pipedrive Official SDK - API v2 POC
Pipedrive Official SDK - API v2 POC
Changes:
Changes:
Created test command jiminny:test-pipedrive-official-sdk
Implemented authorization via SocialAccount.provider_user_token
Tested core SDK methods (9/10 passed)
Documented method mappings in migration plan
Identified known issues (activity fields validation error)
Add or remove reactions
@LakyLak
pipedrive offical SDK v2 POC
pipedrive offical SDK v2 POC
7 / 10 checks OK
907c548
907c548...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
51069
|
|
51070
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
JY-20543 add AJ reports User pilot tracking by LakyLak · Pull Request #11932 · jiminny/app
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app
Close tab
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality
Insights
Insights
Settings
Settings
Important update
Important update
On April 24 we'll start using GitHub Copilot interaction data for AI model training unless you opt out.
Review this update
Review this update
and manage your preferences in your
GitHub account settings
GitHub account settings
.
Dismiss banner
pipedrive offical SDK v2 POC #12090 Edit title
pipedrive offical SDK v2 POC
#
12090
Edit title
Not ready
Not ready
Code
Code
Draft
LakyLak
LakyLak
wants to merge 1 commit into
master
master
from
pipedrive-sdk-poc
pipedrive-sdk-poc
Copy head branch name to clipboard
Lines changed: 1101 additions & 1 deletion
Conversation (0)
Conversation
(
0
)
Commits (1)
Commits
(
1
)
Checks (2)
Checks
(
2
)
Files changed (6)
Files changed
(
6
)
Conversation
Conversation
@LakyLak
Show options
LakyLak commented 4 minutes ago
LakyLak
LakyLak
commented
4 minutes ago
4 minutes ago
Pipedrive Official SDK - API v2 POC
Pipedrive Official SDK - API v2 POC
Changes:
Changes:
Created test command jiminny:test-pipedrive-official-sdk
Implemented authorization via SocialAccount.provider_user_token
Tested core SDK methods (9/10 passed)
Documented method mappings in migration plan
Identified known issues (activity fields validation error)
Add or remove reactions
@LakyLak
pipedrive offical SDK v2 POC
pipedrive offical SDK v2 POC
7 / 10 checks OK
907c548
907c548
This branch has not been deployed
This branch has not been deployed
No deployments
Merge info
Merge info
Review required
Review required
At least 1 approving review is required by reviewers with write access.
Some checks haven't completed yet
Some checks haven't completed yet
2 pending, 1 in progress, 1 expected, 7 successful checks
Collapse checks
Collapse 3 pending checks group
3 pending checks
Checks settings
pending checks
pending checks
ci/circleci: test
ci/circleci: test
ci/circleci: test
Waiting for status to be reported
— CircleCI is running your tests
More actions
ci/circleci: test-backend-lint
ci/circleci: test-backend-lint
ci/circleci: test-backend-lint
Waiting for status to be reported
— CircleCI is running your tests
More actions
SonarCloud Code Analysis
SonarCloud Code Analysis
Expected
— Waiting for status to be reported
Required
Collapse 1 in progress check group
1 in progress check
in progress checks
in progress checks
Loading
build_accept_deploy
build_accept_deploy
build_accept_deploy
Started
6 minutes ago
— Workflow: build_accept_deploy
More actions
Collapse 7 successful checks group
7 successful checks
successful checks
successful checks
ci/circleci: build-backend
ci/circleci: build-backend
ci/circleci: build-backend
— Your tests passed on CircleCI!
More actions
ci/circleci: build-frontend
ci/circleci: build-frontend
ci/circleci: build-frontend
— Your tests passed on CircleCI!
More actions
ci/circleci: checkout-code
ci/circleci: checkout-code
ci/circleci: checkout-code
— Your tests passed on CircleCI!
More actions
ci/circleci: phpstan
ci/circleci: phpstan
ci/circleci: phpstan
— Your tests passed on CircleCI!
More actions
ci/circleci: setup
ci/circleci: setup
ci/circleci: setup
— Your tests passed on CircleCI!
More actions
ci/circleci: test-frontend
ci/circleci: test-frontend
ci/circleci: test-frontend
— Your tests passed on CircleCI!
More actions
setup-workflow
setup-workflow
setup-workflow
Successful in 53s
— Workflow: setup-workflow
More actions
This branch is out-of-date with the base branch
This branch is out-of-date with the base branch
Merge the latest changes from master into this branch. This merge commit will be associated with LakyLak.
Update branch...
|
Firefox
|
pipedrive offical SDK v2 POC by LakyLak · Pull Req pipedrive offical SDK v2 POC by LakyLak · Pull Request #12090 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12090
|
51070
|
|
50514
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-c4b github.com/jiminny/app/pull/12088/changes#diff-c4b70240be9f6f110085428e74a6d3b81d3ce32fb5c1cbbb95e084e8f18d5c90...
|
50514
|
|
50515
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-c4b github.com/jiminny/app/pull/12088/changes#diff-c4b70240be9f6f110085428e74a6d3b81d3ce32fb5c1cbbb95e084e8f18d5c90...
|
50515
|
|
50516
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the
'yes'
flag to enable priority globally.
Refactored Target Selection:
Consolidated
selectExplicitTargetList()
into
selectTargetList()
. The method now strictly evaluates the
$withPriority
boolean argument to choose between normal and high-priority ElasticSearch update lists.
Test Suite Clean-Up
Test Suite Clean-Up
Removed Mocked Redis State:
Stripped out all mock expectations for the priority flag (e.g.,
Redis::shouldReceive('get')->with('updates-with-priority-enabled')
) across multiple test classes, including listener, selector, and processor tests.
Updated Method Calls:
Adjusted test assertions to explicitly pass the
$withPriority = true
argument where the tests previously relied on the mocked global Redis state to trigger high-priority queues.
Import Optimization:
Removed unused
Redis
facade imports from the test files.
Good response
Bad response
Redo
Share & export
Copy
Show more options
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Microphone
Send message
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Summarize page
Summarize page
Skip to content...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-c4b github.com/jiminny/app/pull/12088/changes#diff-c4b70240be9f6f110085428e74a6d3b81d3ce32fb5c1cbbb95e084e8f18d5c90...
|
50516
|
|
50488
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50488
|
|
50489
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50489
|
|
50490
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>JY 20893 chunk control per update target by Vasil-</tabTitle>” with “<selection>@@ -20,6 +20,9 @@ class TargetEntitiesSelectorTest extends TestCase202021public function testTargetStaleChunksFirst(): void21public function testTargetStaleChunksFirst(): void22 {22 {23+$mainChunkSize = 200;24+$staleChunkSize = 50;25+23$batchStatusManager = $this->createMock(BatchStatusInterface::class);26$batchStatusManager = $this->createMock(BatchStatusInterface::class);242725$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];28$this->scheduledBatches = ['scheduled-batch-1', 'scheduled-batch-2'];@@ -28,13 +31,13 @@ public function testTargetStaleChunksFirst(): void28'scheduled-batch-2' => false,31'scheduled-batch-2' => false,29 ];32 ];30// Exactly one batch33// Exactly one batch31-$scheduledEntityIds = range(101, TargetEntitiesSelector::ES_CHUNK_SIZE + 100);34+$scheduledEntityIds = range(101, $mainChunkSize + 100);323533-$batchStatusManager->expects($this->atLeastOnce())36+$batchStatusManager->expects($this->exactly(5))34 ->method('getAllScheduledBatches')37 ->method('getAllScheduledBatches')35 ->willReturnCallback(fn () => $this->scheduledBatches);38 ->willReturnCallback(fn () => $this->scheduledBatches);363937-$batchStatusManager->expects($this->atLeast(2))40+$batchStatusManager->expects($this->exactly(14))38 ->method('isBatchStillInProgress')41 ->method('isBatchStillInProgress')39 ->willReturnCallback(function ($batchName) {42 ->willReturnCallback(function ($batchName) {40return $this->batchesInProgress[$batchName];43return $this->batchesInProgress[$batchName];@@ -45,13 +48,13 @@ public function testTargetStaleChunksFirst(): void45 * I.e. 100 items in chunks of 10 will produce 10 iterations,48 * I.e. 100 items in chunks of 10 will produce 10 iterations,46 * full batch of 250 ill be processed in 5 chunks of 50 items49 * full batch of 250 ill be processed in 5 chunks of 50 items47 */50 */48-$z = (int) floor(TargetEntitiesSelector::ES_CHUNK_SIZE / TargetEntitiesSelector::SMALL_CHUNK_SIZE);51+$z = (int) floor($mainChunkSize / $staleChunkSize);495250-$batchStatusManager->expects($this->atLeast($z))53+$batchStatusManager->expects($this->exactly($z + 1))51 ->method('extractEntityIdsFromBatch')54 ->method('extractEntityIdsFromBatch')52- ->with('scheduled-batch-2', TargetEntitiesSelector::SMALL_CHUNK_SIZE)55+ ->with('scheduled-batch-2', $staleChunkSize)53- ->willReturnCallback(function () use (&$scheduledEntityIds) {56+ ->willReturnCallback(function () use (&$scheduledEntityIds, $staleChunkSize) {54-return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);57+return array_splice($scheduledEntityIds, 0, $staleChunkSize);55 });58 });565957 Redis::shouldReceive('get')60 Redis::shouldReceive('get')@@ -63,15 +66,15 @@ public function testTargetStaleChunksFirst(): void63$highPriorityEnd = 5030;66$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);67$highPriorityRange = range($highPriorityStart, $highPriorityEnd);656866-$normalPrioritySize = TargetEntitiesSelector::ES_CHUNK_SIZE - count($highPriorityRange);69+$normalPrioritySize = $mainChunkSize - count($highPriorityRange);677068$normalPriorityStart = 1;71$normalPriorityStart = 1;69$normalPriorityEnd = 50;72$normalPriorityEnd = 50;70$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);73$normalPriorityRange = range($normalPriorityStart, $normalPriorityEnd);717472 Redis::shouldReceive('spop')75 Redis::shouldReceive('spop')73 ->once()76 ->once()74- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)77+ ->with('activities-for-update-priority', $mainChunkSize)75 ->andReturn($highPriorityRange);78 ->andReturn($highPriorityRange);767977 Redis::shouldReceive('spop')80 Redis::shouldReceive('spop')@@ -87,8 +90,8 @@ public function testTargetStaleChunksFirst(): void87$normalPriority = $selectionList->getNormalPriorityEntityId();90$normalPriority = $selectionList->getNormalPriorityEntityId();88$highPriority = $selectionList->getHighPriorityEntityIds();91$highPriority = $selectionList->getHighPriorityEntityIds();899290-$startOffsetId = 101 + (($i - 1) * TargetEntitiesSelector::SMALL_CHUNK_SIZE);93+$startOffsetId = 101 + (($i - 1) * $staleChunkSize);91-$endOffsetId = 100 + ($i * TargetEntitiesSelector::SMALL_CHUNK_SIZE);94+$endOffsetId = 100 + ($i * $staleChunkSize);929593if ($i < ($z + 1)) {96if ($i < ($z + 1)) {94/**97/**@@ -126,8 +129,10 @@ public function testTargetStaleChunksFirst(): void126129127public function testOnlyHighPriorityEntitiesToProcess(): void130public function testOnlyHighPriorityEntitiesToProcess(): void128 {131 {132+$mainChunkSize = 200;133+129$batchStatusManager = $this->createMock(BatchStatusInterface::class);134$batchStatusManager = $this->createMock(BatchStatusInterface::class);130-$batchStatusManager->expects($this->atLeastOnce())135+$batchStatusManager->expects($this->once())131 ->method('getAllScheduledBatches')136 ->method('getAllScheduledBatches')132 ->willReturn([]);137 ->willReturn([]);133138@@ -137,12 +142,12 @@ public function testOnlyHighPriorityEntitiesToProcess(): void137142138 Redis::shouldReceive('spop')143 Redis::shouldReceive('spop')139 ->never()144 ->never()140- ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);145+ ->with('activities-for-update', $mainChunkSize);141146142 Redis::shouldReceive('spop')147 Redis::shouldReceive('spop')143 ->once()148 ->once()144- ->with('activities-for-update-priority', TargetEntitiesSelector::ES_CHUNK_SIZE)149+ ->with('activities-for-update-priority', $mainChunkSize)145- ->andReturn(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE));150+ ->andReturn(range(1, $mainChunkSize));146151147$selector = $this->getSelector($batchStatusManager);152$selector = $this->getSelector($batchStatusManager);148153@@ -153,7 +158,7 @@ public function testOnlyHighPriorityEntitiesToProcess(): void153$this->assertEmpty($normalPriority);158$this->assertEmpty($normalPriority);154$this->assertNotEmpty($highPriority);159$this->assertNotEmpty($highPriority);155160156-$this->assertEquals(range(1, TargetEntitiesSelector::ES_CHUNK_SIZE), $highPriority);161+$this->assertEquals(range(1, $mainChunkSize), $highPriority);157 }162 }158163159private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector164private function getSelector(BatchStatusInterface $batchStatusManager): TargetEntitiesSelector</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Gemini said
Gemini said
Summary of Changes
Summary of Changes
The selected diff updates
TargetEntitiesSelectorTest
by replacing hardcoded class constants with local variables (
$mainChunkSize
and
$staleChunkSize
) to make the tests more flexible, while explicitly tightening the expected call counts on mock objects.
Detailed Modifications
Detailed Modifications
1. Test Parameterization
1. Test Parameterization
Introduced Local Variables:
Replaced references to
TargetEntitiesSelector::ES_CHUNK_SIZE
with
$mainChunkSize = 200
and
TargetEntitiesSelector::SMALL_CHUNK_SIZE
with
$staleChunkSize = 50
.
Dynamic Range and Offset Calculations:
Updated array ranges, Redis
spop
arguments, and iteration offsets to derive dynamically from these local variables instead of hardcoded class constants.
2. Mock Expectation Hardening
2. Mock Expectation Hardening
getAllScheduledBatches
:
Changed expectations from
atLeastOnce()
to explicit strict counts:
exactly(5)
in
testTargetStaleChunksFirst
once()
in
testOnlyHighPriorityEntitiesToProcess
isBatchStillInProgress
:
Changed expectation from
atLeast(2)
to
exactly(14)
.
extractEntityIdsFromBatch
:...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50490
|
|
50491
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
Ask Gemini
Google Account: [EMAIL]
Summarize page
Summarize page
Skip to content...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50491
|
|
50510
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50510
|
|
50512
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50512
|
|
50513
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50513
|
|
50517
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50517
|
|
50518
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50518
|
|
50519
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the
'yes'
flag to enable priority globally.
Refactored Target Selection:
Consolidated
selectExplicitTargetList()
into
selectTargetList()
. The method now strictly evaluates the
$withPriority
boolean argument to choose between normal and high-priority ElasticSearch update lists.
Test Suite Clean-Up
Test Suite Clean-Up
Removed Mocked Redis State:
Stripped out all mock expectations for the priority flag (e.g.,
Redis::shouldReceive('get')->with('updates-with-priority-enabled')
) across multiple test classes, including listener, selector, and processor tests.
Updated Method Calls:
Adjusted test assertions to explicitly pass the
$withPriority = true
argument where the tests previously relied on the mocked global Redis state to trigger high-priority queues.
Import Optimization:
Removed unused
Redis
facade imports from the test files.
Good response
Bad response
Redo
Share & export
Copy
Show more options
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50519
|
|
50520
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50520
|
|
50521
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50521
|
|
50522
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50522
|
|
50523
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50523
|
|
50524
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50524
|
|
50525
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
Edit
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the
'yes'
flag to enable priority globally.
Refactored Target Selection:
Consolidated
selectExplicitTargetList()
into
selectTargetList()
. The method now strictly evaluates the
$withPriority
boolean argument to choose between normal and high-priority ElasticSearch update lists.
Test Suite Clean-Up
Test Suite Clean-Up
Removed Mocked Redis State:
Stripped out all mock expectations for the priority flag (e.g.,
Redis::shouldReceive('get')->with('updates-with-priority-enabled')
) across multiple test classes, including listener, selector, and processor tests.
Updated Method Calls:
Adjusted test assertions to explicitly pass the
$withPriority = true
argument where the tests previously relied on the mocked global Redis state to trigger high-priority queues.
Import Optimization:
Removed unused
Redis
facade imports from the test files.
Good response
Bad response
Redo
Share & export
Copy
Show more options
any potent
any potent
Open upload file menu
Tools
Open mode picker
Pro
Send message
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50525
|
|
50526
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the
'yes'
flag to enable priority globally.
Refactored Target Selection:
Consolidated
selectExplicitTargetList()
into
selectTargetList()
. The method now strictly evaluates the
$withPriority
boolean argument to choose between normal and high-priority ElasticSearch update lists.
Test Suite Clean-Up
Test Suite Clean-Up
Removed Mocked Redis State:
Stripped out all mock expectations for the priority flag (e.g.,
Redis::shouldReceive('get')->with('updates-with-priority-enabled')
) across multiple test classes, including listener, selector, and processor tests.
Updated Method Calls:
Adjusted test assertions to explicitly pass the
$withPriority = true
argument where the tests previously relied on the mocked global Redis state to trigger high-priority queues.
Import Optimization:
Removed unused
Redis
facade imports from the test files.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issue in app/Component/ES/Processor/Traits/SelectEntityListTrait.php
You said
any potential issue in app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Enter a prompt for Gemini
encrypted
Enter a prompt for Gemini
encrypted
Open upload file menu
Tools
Open mode picker
Pro
Stop response
Your Jiminny chats aren’t used to improve our models. Gemini is AI. It can make mistakes, so double check it.
Your privacy & Gemini Opens in a new window
Your privacy & Gemini
Opens in a new window
Gemini is typing
Summarize page
Summarize page
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)
Pull requests
(
29
)
Agents
Agents
Actions
Actions
Wiki
Wiki
Security and quality
Security and quality...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50526
|
|
50527
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50527
|
|
50528
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50528
|
|
50529
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the
'yes'
flag to enable priority globally.
Refactored Target Selection:
Consolidated
selectExplicitTargetList()
into
selectTargetList()
. The method now strictly evaluates the
$withPriority
boolean argument to choose between normal and high-priority ElasticSearch update lists.
Test Suite Clean-Up
Test Suite Clean-Up
Removed Mocked Redis State:
Stripped out all mock expectations for the priority flag (e.g.,
Redis::shouldReceive('get')->with('updates-with-priority-enabled')
) across multiple test classes, including listener, selector, and processor tests.
Updated Method Calls:
Adjusted test assertions to explicitly pass the
$withPriority = true
argument where the tests previously relied on the mocked global Redis state to trigger high-priority queues.
Import Optimization:
Removed unused
Redis
facade imports from the test files.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issue in app/Component/ES/Processor/Traits/SelectEntityListTrait.php
You said
any potential issue in app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff for...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50529
|
|
50530
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50530
|
|
50531
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50531
|
|
50532
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the
'yes'
flag to enable priority globally.
Refactored Target Selection:
Consolidated
selectExplicitTargetList()
into
selectTargetList()
. The method now strictly evaluates the
$withPriority
boolean argument to choose between normal and high-priority ElasticSearch update lists.
Test Suite Clean-Up
Test Suite Clean-Up
Removed Mocked Redis State:
Stripped out all mock expectations for the priority flag (e.g.,
Redis::shouldReceive('get')->with('updates-with-priority-enabled')
) across multiple test classes, including listener, selector, and processor tests.
Updated Method Calls:
Adjusted test assertions to explicitly pass the
$withPriority = true
argument where the tests previously relied on the mocked global Redis state to trigger high-priority queues.
Import Optimization:
Removed unused
Redis
facade imports from the test files.
Good response
Bad response
Share & export
Copy
Show more options
Copy prompt
Edit
You said any potential issue in app/Component/ES/Processor/Traits/SelectEntityListTrait.php
You said
any potential issue in app/Component/ES/Processor/Traits/SelectEntityListTrait.php
Listen
Show thinking
Gemini said
Gemini said
Based on the provided diff for
app/Component/ES/Processor/Traits/SelectEntityListTrait.php
, the code itself is functionally sound and cleaner. However, this architectural change introduces a couple of potential systemic and operational risks that you should verify.
Here are the potential issues to look out for:
1. Silent Degradation to Normal Priority (Unupdated Callers)
1. Silent Degradation to Normal Priority (Unupdated Callers)
The most significant risk is that other parts of the application might have relied on the implicit Redis check.
The Issue:
Previously, calling
self::selectTargetList(UpdateTarget::ACTIVITY)
(omitting the second argument) could still return the high-priority queue if the Redis flag was flipped on globally. Now, omitting the second argument will
always
default to
false
(normal priority)....
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50532
|
|
50533
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the
'yes'
flag to enable priority globally.
Refactored Target Selection:
Consolidated...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50533
|
|
50534
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant.
Removed Implicit Checks:
Deleted the
processWithPriority()
method, which previously checked Redis for the...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50534
|
|
50535
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen
Show thinking
Gemini said
Gemini said
Overview
Overview
This diff removes the global Redis feature switch (
updates-with-priority-enabled
) that previously controlled priority reindexing. The system now determines priority explicitly via method parameters rather than relying on a global state in Redis.
Core Logic Updates (SelectEntityListTrait)
Core Logic Updates (
SelectEntityListTrait
)
Removed Redis Dependency:
Eliminated the
Illuminate\Support\Facades\Redis
import and the
PRIORITY_TAKES_PLACE
constant....
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50535
|
|
50536
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
New Chat
Open menu for conversation actions.
Conversation with Gemini
Conversation with Gemini
Copy prompt
You said I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev Open in a new github.dev tab Open in codespace Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected. Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
You said
I’m on page “<tabTitle>Jy 20918 remove redis switch for priority reindexi</tabTitle>” with “<selection>Open in github.dev
Open in a new github.dev tab
Open in codespace
Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Jiminny\Component\ES\Processor\Traits;5namespace Jiminny\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\UpdateTarget;8use Jiminny\Component\ES\Processor\UpdateTarget;10use Jiminny\Exceptions\InvalidArgumentException;9use Jiminny\Exceptions\InvalidArgumentException;1110@@ -17,26 +16,12 @@ trait SelectEntityListTrait17private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';16private const string ENTITIES_NORMAL_PRIORITIES_LIST = '%s-for-update';18private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';17private const string ENTITIES_HIGH_PRIORITIES_LIST = '%s-for-update-priority';191820-// Priority flag for selecting the correct target list21-private const string PRIORITY_TAKES_PLACE = 'updates-with-priority-enabled';22-23protected static function selectTargetList(string $entityType, bool $withPriority = false): string19protected static function selectTargetList(string $entityType, bool $withPriority = false): string24 {20 {25if (! in_array($entityType, UpdateTarget::allowedTargets())) {21if (! in_array($entityType, UpdateTarget::allowedTargets())) {26throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');22throw new InvalidArgumentException('AsyncUpdateElasticSearch, invalid entity type');27 }23 }282429-$implicitPriority = self::processWithPriority($withPriority);30-31-return self::selectExplicitTargetList($entityType, $implicitPriority);32- }33-34-/**35- * Omit checking for flag "Priority Enabled" in Redis, EXPLICITLY select the proper set name, based only on36- * method params.37- */38-protected static function selectExplicitTargetList(string $entityType, bool $withPriority = false): string39- {40if ($withPriority) {25if ($withPriority) {41 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');26 Log::debug('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');4227@@ -45,9 +30,4 @@ protected static function selectExplicitTargetList(string $entityType, bool $wit453046return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);31return sprintf(self::ENTITIES_NORMAL_PRIORITIES_LIST, $entityType);47 }32 }48-49-protected static function processWithPriority(bool $withPriority = false): bool50- {51-return $withPriority || Redis::get(self::PRIORITY_TAKES_PLACE) === 'yes';52- }53}33}Original file line numberOriginal file lineDiff line numberDiff line change@@ -17,7 +17,6 @@ class UpdateMultipleTargetsListenerTest extends TestCase17{17{18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void18public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): void19 {19 {20-// Arrange21$entityIds = [1, 2, 3];20$entityIds = [1, 2, 3];22$updateTarget = UpdateTargetEnum::ACTIVITY;21$updateTarget = UpdateTargetEnum::ACTIVITY;23$purpose = 'testing';22$purpose = 'testing';@@ -44,7 +43,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi44 ->with(Mockery::type('string'), $entityIds)43 ->with(Mockery::type('string'), $entityIds)45 ->andReturn(count($entityIds));44 ->andReturn(count($entityIds));464547-// Act48$listener = new UpdateMultipleTargetsListener($logger);46$listener = new UpdateMultipleTargetsListener($logger);49$listener->handle($event);47$listener->handle($event);5048@@ -54,7 +52,6 @@ public function testHandleMethodLogsInfoAndCallsBulkMarkEntitiesForUpdate(): voi545255public function testHandleMethodWithNoPriority(): void53public function testHandleMethodWithNoPriority(): void56 {54 {57-// Arrange58$entityIds = [4, 5, 6];55$entityIds = [4, 5, 6];59$updateTarget = UpdateTargetEnum::OPPORTUNITY;56$updateTarget = UpdateTargetEnum::OPPORTUNITY;60$purpose = 'another_purpose';57$purpose = 'another_purpose';@@ -82,13 +79,6 @@ public function testHandleMethodWithNoPriority(): void82 ->with(Mockery::type('string'), $entityIds)79 ->with(Mockery::type('string'), $entityIds)83 ->andReturn(count($entityIds));80 ->andReturn(count($entityIds));848185-// Redis is also called in selectTargetList method86- Redis::shouldReceive('get')87- ->once()88- ->with('updates-with-priority-enabled')89- ->andReturn(null);90-91-// Act92$listener = new UpdateMultipleTargetsListener($logger);82$listener = new UpdateMultipleTargetsListener($logger);93$listener->handle($event);83$listener->handle($event);9484Original file line numberOriginal file lineDiff line numberDiff line change@@ -72,12 +72,6 @@ public function testHandleMethodWithNoPriority(): void72 ->with(Mockery::type('string'), self::ENTITY_ID)72 ->with(Mockery::type('string'), self::ENTITY_ID)73 ->andReturn(1);73 ->andReturn(1);747475-// Redis is also called in selectTargetList method76- Redis::shouldReceive('get')77- ->once()78- ->with('updates-with-priority-enabled')79- ->andReturn(null);80-81/** @var Dispatcher|MockObject $dispatcher */75/** @var Dispatcher|MockObject $dispatcher */82$dispatcher = $this->createMock(Dispatcher::class);76$dispatcher = $this->createMock(Dispatcher::class);8377Original file line numberOriginal file lineDiff line numberDiff line change@@ -5,7 +5,6 @@5namespace Tests\Unit\Component\ES\Processor\Traits;5namespace Tests\Unit\Component\ES\Processor\Traits;667use Illuminate\Support\Facades\Log;7use Illuminate\Support\Facades\Log;8-use Illuminate\Support\Facades\Redis;9use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;8use Jiminny\Component\ES\Processor\Traits\SelectEntityListTrait;10use Jiminny\Component\ES\Processor\UpdateTarget;9use Jiminny\Component\ES\Processor\UpdateTarget;11use Jiminny\Exceptions\InvalidArgumentException;10use Jiminny\Exceptions\InvalidArgumentException;@@ -27,11 +26,6 @@ public function testSelectTargetListWrongType(): void272628public function testSelectTargetListWithHighPriority(): void27public function testSelectTargetListWithHighPriority(): void29 {28 {30- Redis::shouldReceive('get')31- ->once()32- ->with(self::PRIORITY_TAKES_PLACE)33- ->andReturn('yes');34-35 Log::shouldReceive('debug')29 Log::shouldReceive('debug')36 ->twice()30 ->twice()37 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');31 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');@@ -42,18 +36,17 @@ public function testSelectTargetListWithHighPriority(): void42self::selectTargetList(UpdateTarget::ACTIVITY, true)36self::selectTargetList(UpdateTarget::ACTIVITY, true)43 );37 );443845-// Priority is globally switched on via redis46$this->assertEquals(39$this->assertEquals(47'opportunities-for-update-priority',40'opportunities-for-update-priority',48-self::selectTargetList(UpdateTarget::OPPORTUNITY)41+self::selectTargetList(UpdateTarget::OPPORTUNITY, true)49 );42 );50 }43 }514452public function testSelectTargetListWithNormalPriority(): void45public function testSelectTargetListWithNormalPriority(): void53 {46 {54-Redis::shouldReceive('get')47+Log::shouldReceive('debug')55- ->with(self::PRIORITY_TAKES_PLACE)48+ ->never()56- ->andReturn(false);49+ ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');575058// Explicitly select priority list51// Explicitly select priority list59$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));52$this->assertEquals('activities-for-update', self::selectTargetList(UpdateTarget::ACTIVITY));Original file line numberOriginal file lineDiff line numberDiff line change@@ -54,11 +54,6 @@ public function testTargetStaleChunksFirst(): void54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);54return array_splice($scheduledEntityIds, 0, TargetEntitiesSelector::SMALL_CHUNK_SIZE);55 });55 });565657- Redis::shouldReceive('get')58- ->once() // High-priority list will not execute this check59- ->with('updates-with-priority-enabled')60- ->andReturn(null);61-62$highPriorityStart = 5001;57$highPriorityStart = 5001;63$highPriorityEnd = 5030;58$highPriorityEnd = 5030;64$highPriorityRange = range($highPriorityStart, $highPriorityEnd);59$highPriorityRange = range($highPriorityStart, $highPriorityEnd);@@ -131,10 +126,6 @@ public function testOnlyHighPriorityEntitiesToProcess(): void131 ->method('getAllScheduledBatches')126 ->method('getAllScheduledBatches')132 ->willReturn([]);127 ->willReturn([]);133128134- Redis::shouldReceive('get')135- ->never() // High priority list will not execute this check136- ->with('updates-with-priority-enabled');137-138 Redis::shouldReceive('spop')129 Redis::shouldReceive('spop')139 ->never()130 ->never()140 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);131 ->with('activities-for-update', TargetEntitiesSelector::ES_CHUNK_SIZE);Original file line numberOriginal file lineDiff line numberDiff line change@@ -18,7 +18,6 @@ public function testMarkEntityForUpdate(): void18 {18 {19$activityId = 12457;19$activityId = 12457;202021- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');22 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);21 Redis::shouldReceive('sadd')->once()->with('activities-for-update', $activityId);232224 Log::shouldReceive('info')->once()->withAnyArgs();23 Log::shouldReceive('info')->once()->withAnyArgs();@@ -34,37 +33,26 @@ public function testBulkMarkEntitiesForUpdate(): void34// Add some entities33// Add some entities35$activities = [12457, 87612512];34$activities = [12457, 87612512];363537- Redis::shouldReceive('get')->once()->with('updates-with-priority-enabled')->andReturn('no');38 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);36 Redis::shouldReceive('saddarray')->once()->with('activities-for-update', $activities);393740 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);38 AsyncUpdateElasticSearch::bulkMarkEntitiesForUpdate(UpdateTarget::ACTIVITY, $activities);41 }39 }424043public function testGetEntitiesSourceList(): void41public function testGetEntitiesSourceList(): void44 {42 {45- Redis::shouldReceive('get')46- ->twice()47- ->with('updates-with-priority-enabled')48- ->andReturn('yes');49-50$this->assertEquals(43$this->assertEquals(51-'activities-for-update-priority',44+'activities-for-update',52 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)45 AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::ACTIVITY)53 );46 );544755$this->assertEquals(48$this->assertEquals(56'opportunities-for-update-priority',49'opportunities-for-update-priority',57- AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY)50+ AsyncUpdateElasticSearch::getEntitiesSourceList(UpdateTarget::OPPORTUNITY, true)58 );51 );59 }52 }605361public function testGetEntitiesListCount(): void54public function testGetEntitiesListCount(): void62 {55 {63- Redis::shouldReceive('get')64- ->once()65- ->with('updates-with-priority-enabled')66- ->andReturn(null);67-68 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);56 Redis::shouldReceive('scard')->once()->with('activities-for-update')->andReturn(3);69 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);57 Redis::shouldReceive('scard')->once()->with('opportunities-for-update-priority')->andReturn(12);7058Original file line numberOriginal file lineDiff line numberDiff line change@@ -96,8 +96,6 @@ public function testRunDoUpdateButThrottled(): void96 ->once()96 ->once()97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');97 ->with('[AsyncUpdateElasticSearch] - Priority check passed and priority is on');989899-// Update with priority (for all) is not enabled100- Redis::shouldReceive('get')->with('updates-with-priority-enabled')->andReturn(null);101// Reschedule High priority99// Reschedule High priority102 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);100 Redis::shouldReceive('saddarray')->with('activities-for-update-priority', $this->highPriority);103// Reschedule low priority101// Reschedule low priority</selection>” selected.
Please summarize the selection using precise and concise language. Use headers and bulleted lists in the summary, to make it scannable. Maintain the meaning and factual accuracy.
Expand
Listen...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50536
|
|
50537
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
JY-20891 add support for secondary email by LakyLak · Pull Request #12073 · jiminny/app
[JY-20891] Sidekick SMS issue - Jira
[JY-20891] Sidekick SMS issue - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
[JY-20915] Add environment-specific email domains for text relay to prevent duplicate processing - Jira
Usage | Windsurf
Usage | Windsurf
[SRD-6853] Moxso - Potential deal stages bug - Jira
[SRD-6853] Moxso - Potential deal stages bug - Jira
Pipelines - jiminny/app
Pipelines - jiminny/app
Feed — jiminny — Sentry
Feed — jiminny — Sentry
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
Pipedrive API Reference and Documentation
Pipedrive API Reference and Documentation
pipedrive/client-php: Pipedrive API client for PHP
pipedrive/client-php: Pipedrive API client for PHP
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
[jiminny/infrastructure] JY-20623 Add SQS queue for panorama reports (PR #728) - [EMAIL] - Jiminny Mail
Pull requests · jiminny/app
Pull requests · jiminny/app
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20906] Review of Pipedrive SDK - Jira
[JY-20906] Review of Pipedrive SDK - Jira
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
JY 20893 chunk control per update target by Vasil-Jiminny · Pull Request #12086 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app
Close tab
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
Jy 20846 mcp enable the ai to know details about the user by nikolaybiaivanov · Pull Request #12075 · jiminny/app
New Tab
Customize sidebar
Close Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AI Chat settings
Close
WORK, Google Account: [EMAIL]
Main menu
New chat
Gemini
Skip to content
Skip to content
Open menu
Homepage (g then d)
jiminny
jiminny
app
app
Search or jump to…
Type
/
to search
Chat with Copilot
Open Copilot…
Create new...
All issues(g then i)
All pull requests
All repositories
You have unread notifications(g then n)
Open user navigation menu
Repository navigation
Repository navigation
Code
Code
Pull requests (29)...
|
Firefox
|
Jy 20918 remove redis switch for priority reindexi Jy 20918 remove redis switch for priority reindexing by Vasil-Jiminny · Pull Request #12088 · jiminny/app — Work...
|
github.com/jiminny/app/pull/12088/changes#diff-4a1 github.com/jiminny/app/pull/12088/changes#diff-4a1e0ff3a25c28615f1bf22dc2d6b441b1d1926a2befa1226494a7aed1aeef53...
|
50537
|