Data not saving from iPhone Safari on Cognition.run despite using on_data_update and save() #3575
Unanswered
shahdiya30
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi, Diya, A long time ago, I also experienced the similar situation; iPhone data wasn't saved. In my case, I wasn't using Cognition, so this issue might be unrelated to Cognition. I'm sorry, but since it happened quite a while ago, I don't remember the details. Updating jsPsych to version 7 or higher might resolve the issue. Best, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I’m running a jsPsych 6.3 experiment via Cognition.run. I’ve used on_data_update and save(jsPsych.data.get().json()) after every trial, and even added manual calls to save() before jsPsych.finishTrial() inside a custom plugin. Despite that, data does not save at all when users exit mid-experiment on iPhone Safari.
What I’ve tried:
Saving via on_data_update (with/without setTimeout)
Calling save() manually inside plugin trial endings
Using document.visibilitychange and pagehide events
Everything works perfectly on desktop. But on iOS Safari, closing the tab causes all data to be lost.
Is this a known Cognition limitation on iPhone?
Is there a workaround or alternative save strategy that works reliably on mobile?
Any help would be hugely appreciated!
Thanks so much,
Diya
Beta Was this translation helpful? Give feedback.
All reactions