open-cogsci / opensesame-extension-osf

Open Science Framework module for OpenSesame3
Other
4 stars 1 forks source link

Sometimes asked to update on OSF immediately after downloading from OSF #10

Open smathot opened 8 years ago

smathot commented 8 years ago

When you download an experiment from the OSF, you are first asked to save the experiment locally. This works fine. But then, once the experiment has been downloaded, opened, and saved locally, you sometimes get asked immediately whether you want to update the experiment on the OSF. This is strange, because it happens before you've made any changes to the experiment.

It doesn't always happen; it doesn't happen when I download my own experiments, but it does reliably happen when downloading an experiment shared with me by a colleague. The origin of the issue is unclear to me.

dschreij commented 8 years ago

"That's not a bug, it's a feature!", but jokes aside, this is because for some good reason (which I can't currently remember but will try to find out shortly), I automatically save the experiment right after it has been downloaded. You probably don't get to see the prompt if the box "Always upload on save" is checked in the downloaded experiment. In this case, the experiment on the OSF is automatically updated without approval of the user.

dschreij commented 8 years ago

Right, I think I found the reason. If the osf_id is not present yet in the variable registry of the experiment (for instance if one has uploaded the experiment through the web interface of OSF and not via the OSF Explorer inside OpenSesame), then osf_id is added to the variable registry after which the experiment is synced to the OSF again. This osf_id needs to be added to both the remote and local versions to make sure the syncing features work.

See https://github.com/dschreij/opensesame-extension-osf/blob/master/opensesame_extensions/OpenScienceFramework/OpenScienceFramework.py#L1422-L1428

smathot commented 8 years ago

Ah that must be it then! That also explains why it only happens with some experiments. I think we can close this issue then, don't you?

dschreij commented 8 years ago

Yes, I agree this can be done more gracefully, but it is not really an issue per sé. For now I'll give it an enhancement label to keep it on our radar and maybe smooth this out in the future.