Skip to content

535 Fix download data redirect#534

Open
martinherrerias wants to merge 9 commits into
masterfrom
fix-download-data-redirect
Open

535 Fix download data redirect#534
martinherrerias wants to merge 9 commits into
masterfrom
fix-download-data-redirect

Conversation

@martinherrerias

@martinherrerias martinherrerias commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Purpose

#535: Matlab's websave seems to struggle with the redirect chain 301 → 308 → 302 required for some OSF paths (e.g. mp2rage). So the same link that works on UNIX (with curl -L) currently fails on Windows.

(local-branch version of #528)

Approach

Added a fifth download option to downloadData that sends repeated matlab.net.http requests and tries to follow the response "Location" header.

I've then refactored the whole function so that it can be unit-tested, and added tests for all methods.

Open Questions and Pre-Merge TODOs

  • Use github checklists. When solved, check the box and explain the answer.

  • Review that changed source files/lines are related to the pull request/issue
    If any files/commits were accidentally included, cherry-pick them into another branch.

  • Review that changed source files/lines were not accidentally deleted
    Fix appropriately if so.

  • Test new features or bug fix
    If not implemented/resolved adequately, solve it or inform the developer by requesting changes in your review.
    Preferably, set breakpoints in the locations that the code was changed and follow allong line by line to see if the code behaves as intended.

Manual GUI tests (general)
  • Does the qMRLab GUI open?
  • Can you change models?
  • Can you load a data folder for a model?
  • Can you view data?
  • Can you zoom in the image?
  • Can you pan out of the image?
  • Can you view the histogram of the data?
  • Can you change the color map?
  • Can you fit dataset (Fit data)?
  • Can you save/load the results?
  • Can you open the options panel?
  • Can you change option parameters?
  • Can you save/load option paramters?
  • Can you select a voxel?
  • Can you fit the data of that voxel ("View data fit")?
  • Can you simulate and fit a voxel ("Single Voxel Curve")?
  • Can you run a Sensitivity Analysis?
  • Can you simulate a Multi Voxel Distribution?
Specifications
  • Version:
  • Platform:
  • Subsystem:

WEBSAVE struggles with the chain 301 -> 308 -> 302 required for some OSF paths.
- Refactor into subfunctions to enable unit testing
- Expose 'attempts' and 'timeout' parameters (apply to all methods)
- Lint, document
@martinherrerias martinherrerias linked an issue May 11, 2026 that may be closed by this pull request
@martinherrerias martinherrerias changed the title Fix download data redirect 535 Fix download data redirect May 11, 2026

@mathieuboudreau mathieuboudreau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the feature on a Mac and it works as expected - I don't have a windows to test it on so I'll take your word that it works on your end @martinherrerias !

I did a few minor edits @martinherrerias , you can have a quick look, but overall looks good to me! Thank you!

@martinherrerias

Copy link
Copy Markdown
Collaborator Author

Changes look good, sorry about those typos. I fixed one more that was making the tests fail, I say it's ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example data download fails on Windows

2 participants