When user send bulk messages for example to all group members in a group, the message does not deliver. Furthermore, we do not receive any form of error notification or feedback regarding the delivery failure.
After an investigation has been discovered that during this activity it generates the following error:
TypeError: array_map(): Argument #2 ($array) must be of type array, bool given in /app/html/modules/contrib/social_pwa/src/WebPushManager.php on line 71 #0 /app/html/modules/contrib/social_pwa/src/WebPushManager.php(71): array_map(Object(Closure), false)
#1 /app/html/modules/contrib/social_pwa/modules/activity_send_push/src/Plugin/ActivitySend/PushActivitySend.php(98): Drupal\social_pwa\WebPushManager->getSubscriptionsForUser(Object(Drupal\social_user\Entity\User))
#2 /app/html/modules/contrib/social_pwa/modules/activity_send_push/activity_send_push.module(24): Drupal\activity_send_push\Plugin\ActivitySend\PushActivitySend->process(Object(Drupal\activity_creator\Entity\Activity))
#3 [internal function]: activity_send_push_activity_insert(Object(Drupal\activity_creator\Entity\Activity))
#4 /app/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(409): call_user_func_array(Object(Closure), Array)
#5 /app/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(388): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'activity_send_p...')
#6 /app/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(416): Drupal\Core\Extension\ModuleHandler->invokeAllWith('activity_insert', Object(Closure))Proposed resolution
Add a check to make sure that user data is always as an array because get() has a mixed type of return value: array, null, bool.
Issue fork social_pwa-3425488
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
sv commentedComment #4
ribelChanges were tested and works without regression.
Comment #5
sv commentedComment #8
robertragas commentedMerged and will be landing in 2.0.5 and 2.1.2
Comment #9
robertragas commented