Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Error "Can only send one result data at a time"

Hello!

I've run into this error during a call to submitResultData :

`Can only send one result data at a time`

I attach a photo with the code and stack (line 337 is the culprit in this component).


As far as I can tell, I'm not doing that. This error also doesn't happen reliably. Only on some components, most of the time (not all the time). So I'd love anyone's advice as to what sort of things I should be looking at to troubleshoot why I'm making this happen!

All advice welcome!

Warm regards,

Dorian

Comments

  • Hi Dorian,

    It looks like you send the result data twice in quick succession. First you send it in on_finish and then second in on_close . Sending the result data once is enough (at least with jatos.submitResultData - if you want to append then use jatos.appendResultData). So removing one of them should solve your problem.

    And that this error happens not all the time is caused by the different response times to your requests. Your requests take different times each time you send them (caused by the internet speed or your server's resources). So sometimes the result data request got already a response, when you send it the second time, and sometimes not. In the latter case jatos.js throws an error because it is allowed to send only one at a time.

    But if you need both, on_finish and on_close, you have to work with the Promises jatos.js returns. I can help you with that.

    Best,

    Kristian

  • edited September 2021

    Hi Kristian,

    Amazing response time mate, appreciate it.

    The rationale behind having the on_close is in case someone accidentally closes the browser before finishing. Try to save the data. Do you have any ideas about how to do that (easily) without this request pile up?

    You mention using the promises. I don't want to create a great deal of work for this kind of paranoia. I'm happy to just risk data loss and be sure I'm saving data at time points when that data would be useful!

    Warm regards,

    Dorian

  • Hi Dorian,

    actually, which JATOS version do you run on your server? Maybe a newer version can help here already.

    Best,

    Kristian

  • Yes. Good question that I'm already following up. I think a couple of the problems I'm having are version related. I might not be able to upgrade though. Depends on my department.

    For your interest:

    1. I ran into the issue again, with overlapping submitResultData requests. I tried to get some feedback using the returned promise:

    jatos.submitResultData(resultData)
       .then(() => console.log('result data submitted'))
       .catch(() => console.log('result data submission failed'));
    

    And was told that catch wasn't a function. This didn't matter so much, because I just wanted to see which request was returning so late, so I just deleted the catch. I think this is version related (hence my note above), but if it's not you might be interested.

    2. I ended up solving the overlapping requests by just putting jsPsych trials into my experiment that wait 30-60 seconds after I send a request. Not very sexy, but it gets the job done. Thanks for helping me understand the nature of the problem! I would have never gotten here elsewise.


    I'm curious, is there a way to know whether it's my department's JATOS server that's slow or if it's my dev computer?


    If I hear back on the version I'll let you know. Maybe we can get some closure on this.

  • krikri
    edited September 2021

    You can get the version via jatos.version. Should give you back a string.

    (I'll answer the rest later)

  • Version 3.3.3!

  • Yes, a newer JATOS version would help here. In v3.5.3 we added the 'httpLoop', that deals with this kind of problems. The current version is v3.6.1.

    Nice that you could find a solution that works for you. There is no ugly solution if it does the job :).

    But if you want to try out something you could also:

    await jatos.submitResultData(resultData);
    

    But it might also fail because of your older version.

    And was told that catch wasn't a function.

    Likely also caused by your older version.

    Best,

    Kristian

  • Yes right. Well I suspect a version update is a no go from the department. Not fast, at any rate.

    I'll let you know if I ever dare to touch the code again to implement the await operator. Asynchronous stuff scares me though.


    Cheers for all your help!

  • That's a shame. JATOS gets updates constantly. Maybe try to talk to your admin again or tell him to talk to me. Updates are less difficult then they seem. And the newer versions have an automatic update that makes it even easier.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games