View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
18582Feature requestsRemoteControlpublic2023-01-30 13:47
Reporterginosupport Assigned Togabrieljenik  
PrioritynormalSeverity@60@ 
Status closedResolutionfixed 
Summary18582: RemoteControl invite_participants unexpectedly stops after first failure
Description

RemoteControl invite_participants without specifying specific particpants doesn't send any invitations after encountering the first participant that cannot be invited (yet).

The effect is that if someone added a participant with some validity date in the future, any later participants are never invited until the older one with the future validity becomes valid.

Steps To Reproduce

Steps to reproduce

  • Create any survey
  • Add 3 participants with valid email addresses.
    Participant 1 is valid from yesterday (can be invited)
    Participant 2 is valid in the future (cannot be invited yet)
    ** Participant 3 is valid from yesterday (can be invited)

Call the remote control invite_participants method without supplying any participants, for example:
{
"method" : "invite_participants",
"parameters" : {
"iSurveyID" : "663586"
}
}

Expected result

Participant 1 and 3 were invited, 2 was skipped

Actual result

Participant 1 was invited, participant 2 was skipped. Participant 3 is ignored completely. Actual response is similar to this:
{
"id" : 1,
"result" : {
"14" : {
"name" : "Anonymised Name",
"email" : "anonymous@address",
"status" : "OK"
},
"15" : {
"name" : "Anonymised Name",
"email" : "anonymous@address",
"status" : "fail",
"error" : "Token not valid yet"
},
"status" : "0 left to send"
},
"error" : null
}

TagsNo tags attached.
Bug heat10
Story point estimate
Users affected %

Relationships

duplicate of 16328 closedgabrieljenik Bug reports invite_participants exits on first error 

Users monitoring this issue

There are no users monitoring this issue.

Activities

ginosupport

ginosupport

2023-01-06 15:36

reporter   ~73375

By the way, if you click the invitations button from the admin screen, it will show the list of id's for participant 1, 2 and 3 and invite participants 1 and 3 and skip participant 2 as expected

ollehar

ollehar

2023-01-06 16:05

administrator   ~73377

Is it possible for you to give us a pull request with the fix?

ginosupport

ginosupport

2023-01-06 16:26

reporter   ~73378

Sorry, I wouldn't really feel comfortable doing that. I'm not at all familiar with the code base (or even with PHP for that matter).

gabrieljenik

gabrieljenik

2023-01-20 12:50

manager   ~73508

Moving this to a Feature Request.
The stopping is behaving as expected:

https://api.limesurvey.org/classes/remotecontrol_handle.html#method_invite_participants

Returns array of results of sending. The sending stops on the first error (ie. when a token is invalid).

ginosupport

ginosupport

2023-01-23 09:57

reporter   ~73523

Well, I will give you that it is as documented (which I missed, I must admit, although we implemented our API ) :) I still think it's a bit odd that the same functionality of 'don't select any participants in particular and just invite all participants that are valid' from the admin panel works as I expect it to, but the remote control API has different rules. It seems like there's no way for me to emulate with RemoteControl, what I can do in the admin panel. Am I missing something here?

Of course i would then expect the same for remind_participants, but I didn't check if that behaves the same way.

gabrieljenik

gabrieljenik

2023-01-23 12:30

manager   ~73528

As discussed with @c_schmitz will be working on this.
Should add a new parameter: continueOnError = false

remind_participants should be updated as well.

gabrieljenik

gabrieljenik

2023-01-24 18:53

manager   ~73546

PR: https://github.com/LimeSurvey/LimeSurvey/pull/2866

gabrieljenik

gabrieljenik

2023-01-25 13:52

manager   ~73558

Marking it as tested as it has the automatic test

guest

guest

2023-01-26 10:52

viewer   ~73573

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=34240

LimeBot

LimeBot

2023-01-30 13:47

administrator   ~73602

Fixed in Release 5.6.3+230130

Related Changesets

LimeSurvey: master a4068182

2023-01-26 10:52:05

Gabriel Jenik


Committer: GitHub Details Diff
Fixed issue 18582: RemoteControl invite_participants unexpectedly stops after first failure (#2866)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
18582
mod - application/helpers/admin/token_helper.php Diff File
mod - application/helpers/remotecontrol/remotecontrol_handle.php Diff File
add - tests/data/surveys/limesurvey_survey_InviteParticipantsTest.lsa Diff File
mod - tests/unit/helpers/remotecontrol/BaseTest.php Diff File
add - tests/unit/helpers/remotecontrol/InviteParticipantsTest.php Diff File

Issue History

Date Modified Username Field Change
2023-01-06 15:23 ginosupport New Issue
2023-01-06 15:36 ginosupport Note Added: 73375
2023-01-06 15:36 ginosupport Bug heat 0 => 2
2023-01-06 16:05 ollehar Note Added: 73377
2023-01-06 16:05 ollehar Bug heat 2 => 4
2023-01-06 16:05 ollehar Priority none => normal
2023-01-06 16:26 ginosupport Note Added: 73378
2023-01-16 17:54 gabrieljenik Status new => acknowledged
2023-01-16 18:01 gabrieljenik Assigned To => gabrieljenik
2023-01-16 18:01 gabrieljenik Status acknowledged => assigned
2023-01-20 12:47 gabrieljenik Relationship added duplicate of 16328
2023-01-20 12:49 gabrieljenik Project Bug reports => Feature requests
2023-01-20 12:50 gabrieljenik Note Added: 73508
2023-01-20 12:50 gabrieljenik Bug heat 4 => 6
2023-01-20 12:50 gabrieljenik Assigned To gabrieljenik =>
2023-01-20 12:50 gabrieljenik Status assigned => acknowledged
2023-01-23 09:57 ginosupport Note Added: 73523
2023-01-23 12:30 gabrieljenik Assigned To => gabrieljenik
2023-01-23 12:30 gabrieljenik Status acknowledged => confirmed
2023-01-23 12:30 gabrieljenik Note Added: 73528
2023-01-24 18:53 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-01-24 18:53 gabrieljenik Status confirmed => ready for code review
2023-01-24 18:53 gabrieljenik Note Added: 73546
2023-01-25 07:46 DenisChenu Assigned To DenisChenu =>
2023-01-25 07:46 DenisChenu Status ready for code review => ready for testing
2023-01-25 13:52 gabrieljenik Assigned To => gabrieljenik
2023-01-25 13:52 gabrieljenik Status ready for testing => ready for merge
2023-01-25 13:52 gabrieljenik Note Added: 73558
2023-01-26 10:52 Changeset attached => LimeSurvey master a4068182
2023-01-26 10:52 guest Note Added: 73573
2023-01-26 10:52 guest Bug heat 6 => 8
2023-01-30 13:47 LimeBot Note Added: 73602
2023-01-30 13:47 LimeBot Status ready for merge => closed
2023-01-30 13:47 LimeBot Resolution open => fixed
2023-01-30 13:47 LimeBot Bug heat 8 => 10