Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Disconnected from the server after I upload spectrum #30

Closed
1 task done
magagranados opened this issue Aug 14, 2023 · 7 comments
Closed
1 task done

[Bug]: Disconnected from the server after I upload spectrum #30

magagranados opened this issue Aug 14, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@magagranados
Copy link

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

No response

Platform and OS Version

No response

Existing Issues

No response

What happened?

After I upload a spectrum, I am disconnected from the server and the page requests me to reload. I cannot compare or analyze any spectrum in SPC format.

image

Steps to reproduce

  1. Click "browse"
  2. Upload my file in SPC format
  3. Choose the preprocessing and identification options.
    ...

Expected behavior

It is expected that after I upload the spectrum, I can preprocess and identify the particle spectrum

Attachments

No response

Screenshots or Videos

image

Additional Information

No response

@magagranados magagranados added the bug Something isn't working label Aug 14, 2023
@zsteinmetz
Copy link
Collaborator

This sounds like Shiny app problem. I transfer the issue there.

@zsteinmetz zsteinmetz transferred this issue from wincowgerDEV/OpenSpecy-package Aug 15, 2023
@wincowgerDEV
Copy link
Owner

Hey @magagranados, thanks for letting us know about this. Can you share the spc file that is causing the issue? It is challenging for us to debug without the file that crashes the server.

@magagranados
Copy link
Author

magagranados commented Aug 22, 2023

Hi, here is an example
SPC-2.zip

@wincowgerDEV
Copy link
Owner

Thank you @magagranados. @zsteinmetz, this actually seems like a problem with the package read_any function, getting this error from the function:

Error in gsub(rawToChar(replace.nul), "\r\n", log.txt) : 
  'pattern' is invalid
In addition: Warning message:
In gsub(rawToChar(replace.nul), "\r\n", log.txt) :
  unable to translate '<ff>' to a wide string

Unfortunately the issue is coming from the read.spc() from hyperSpec. We will need to rewrite their source code to fix it which will likely take us some time because a lot of these unique file formats are tricky to convert. We should be handling the errors better though instead of letting the app crash and I can work on that for the shiny app sooner rather than later. @magagranados, for now I recommend converting your file into a different format using another software. We have some instructions about how you can use spectragryph to transform your files in our vignette towards the end: https://cran.r-project.org/web/packages/OpenSpecy/vignettes/sop.html

@zsteinmetz
Copy link
Collaborator

We should be handling the errors better though instead of letting the app crash and I can work on that for the shiny app sooner rather than later.

Agree, @wincowgerDEV. Should we keep the issue here until then?

Instead of trying to completely rewrite their code, I suggest to first approach the hyperSpec maintainers. They have discussed similar issues already; see for instance r-hyperspec/hyperSpec#80 which might soon be fixed with this PR: r-hyperspec/hySpc.read.spc#22

@magagranados would you mind open another issue at https://github.com/r-hyperspec/hySpc.read.spc/issues. If they can fix it, we can benefit from it downstream.

@wincowgerDEV
Copy link
Owner

Agree, @wincowgerDEV. Should we keep the issue here until then?

Instead of trying to completely rewrite their code, I suggest to first approach the hyperSpec maintainers. They have discussed similar issues already; see for instance r-hyperspec/hyperSpec#80 which might soon be fixed with this PR: r-hyperspec/hySpc.read.spc#22

Yeah I think it is fine to keep the issue here and we will close it once we fix the bug in the app. Agreed, it seems like hyperSpec is putting in work right now, likely a ton of new features and bug fixes coming down the pipeline.

@wincowgerDEV
Copy link
Owner

Now catching the incompatible file types with an error message instead of a crash
311a1c4

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants