Skip to content

BF: Fixed .js file not being found when using "Use version" (removed _legacy from suffix)#6515

Merged
TEParsons merged 2 commits intopsychopy:devfrom
RebeccaHirst:_prevent_legacy_extension_on_js
Jun 5, 2024
Merged

BF: Fixed .js file not being found when using "Use version" (removed _legacy from suffix)#6515
TEParsons merged 2 commits intopsychopy:devfrom
RebeccaHirst:_prevent_legacy_extension_on_js

Conversation

@RebeccaHirst
Copy link
Copy Markdown
Contributor

When a psychopy builder file has been synced to pavlovia, the pavlovia project creates the url run.pavlovia.org/username/projectname where projectname is the name of the js file it is looking for. If you use Use Version then at the moment it compiles projectname_legacy.js - which means that file is not used by the pavlovia project. We need the js file that is compiled to always be the same name as the .psyexp file we are working on and syncing from, even if a different version is used.

Here we prevent the "_legacy.js" ONLY on the js files so it only affects this part of the compiling process.

When a psychopy builder file has been synced to pavlovia, the pavlovia project creates the url run.pavlovia.org/username/projectname where projectname is the name of the js file it is looking for. If you use Use Version then at the moment it compiles projectname_legacy.js - which means that file is not used by the pavlovia project. We need the js file that is compiled to always be the same name as the .psyexp file we are working on and syncing from, even if a different version is used.
@codecov
Copy link
Copy Markdown

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.14%. Comparing base (5feb840) to head (952fcfa).
Report is 21 commits behind head on dev.

Current head 952fcfa differs from pull request most recent head 2220ed9

Please upload reports for the commit 2220ed9 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6515      +/-   ##
==========================================
+ Coverage   50.75%   51.14%   +0.39%     
==========================================
  Files         333      331       -2     
  Lines       60839    60718     -121     
==========================================
+ Hits        30878    31057     +179     
+ Misses      29961    29661     -300     
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)

@TEParsons
Copy link
Copy Markdown
Contributor

Okay yep, I've dug a bit deeper and this is the correct solution :) Basically, that code was originally there because the index file was looking for a file with _legacy, but now it's (correctly) looking for just the experiment name. I'll just add a commit to delete the lines around it before committing, as they're now doing nothing (just splitting outfile apart then putting it back together unchanged)

@TEParsons TEParsons changed the title BF: Prevent _legacy on js compiled file BF: Fixed .js file not being found when using "Use version" (removed _legacy from suffix) Jun 3, 2024
@TEParsons TEParsons merged commit 0a5945c into psychopy:dev Jun 5, 2024
@peircej peircej added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Issue describes a bug (crash or error) or undefined behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants