jsPsych Pavlovia plugin - Problems with redirecting participants after completion

URL of experiment:

Description of the problem:

I am running an online experiment programmed with jsPsych and which I host on Pavlovia. Thus, I use the jsPsych Pavlovia plugin (2022.1.1) for communication with the Pavlovia server. Participants’ data is successfully uploaded to the server when they complete the experiment but I got feedback that on their side the experiment “freezes” after the last trial with the message “Please wait a moment while the data are uploaded to the pavlovia.org server…”. This prevents participants to get to the redirection URL that would send them back to Prolifics where I recruit participants (causing messages about the problem, missing completion codes for participants, and potential timed-out status if participants do not close the last page themselves).

How am I supposed to embed the proper ending of the experiment within my code?

Currently it looks the following (previous lines omitted):

  1. Finish connection with pavlovia

     var pavlovia_finish = {
         type: jsPsychPavlovia,
         command: "finish",
         participantId: subject_id,
     };
     timeline.push(pavlovia_finish);
    
  2. Insert waiting trial to ensure upload to the server is completed

     var wait5sec = {
         type: 'html-keyboard-response',
         stimulus: `<div class="message">
             <p>Wait while your data is being saved...</p>
             </div>`,
         choices: "NO_KEYS",
         trial_duration: 5000
         };
    
     timeline.push(wait5sec)
    
  3. Redirect participants to prolific by clicking a link

     var redirect_trial = {
          type: jsPsychHtmlKeyboardResponse,
          stimulus: `<div class="message">
              <p>Thank you very much for participating!</p>
              <br>
              <p><a href="https://app.prolific.co/submissions/complete?cc=XXXXXX">Click here to return to Prolific and complete the study</a>.</p>
              </div>`,
          choices: "NO_KEYS"
          }
     timeline.push(redirect_trial)
    
  4. Run experiment

     jsPsych.run(timeline);
    

So the problem seems to be that participants never make it to the waiting and redirect trial. Are all trials pushed after the pavlovia_finish trial omitted? Am I missing some statement in the pavlovia_finish trial (e.g., completedCallbackfunction)?

Any help or hints very appreciated!

Best
Mutzkey