Skip to content

Conversation

@vchendrix
Copy link
Collaborator

Previously, the addFilesAndFolders function did not correctly handle the creation of subfolders with the same name. This fix ensures that all subfolders are created properly by constructing the full path for each folder and checking against the pathMap to avoid duplicates.

  • Updated the addFilesAndFolders function to construct the full path for each folder.
  • Ensured that the pathMap is updated with the correct paths for all subfolders.
  • Added detailed comments to the addFilesAndFolders function for better readability and maintenance.

This resolves the issue where subfolders with the same name were not being created correctly.

Closes #2442

@robyngit robyngit changed the base branch from main to develop December 5, 2024 14:44
@vchendrix
Copy link
Collaborator Author

@robyngit @rushirajnenuji let me know if you have any questions. I am happy to work with you to get this resolved. This is a critical fix for us as we will not be able to offer support for hierarchical dataset viewing until this is resolve.

@vchendrix
Copy link
Collaborator Author

@robyngit @rushirajnenuji Happy New Year! Now that I am familiar with the testing framework, I will see if I can get the linting issues fixed.

@vchendrix vchendrix force-pushed the issue-2442-hierarchical-view-missing-folders branch 3 times, most recently from 6df8658 to df6d489 Compare January 7, 2025 17:54
…created

Previously, the `addFilesAndFolders` function did not correctly handle the
creation of subfolders with the same name. This fix ensures that all
subfolders are created properly by constructing the full path for each
folder and checking against the `pathMap` to avoid duplicates.

- Updated the `addFilesAndFolders` function to construct the full path for each folder.
- Ensured that the `pathMap` is updated with the correct paths for all subfolders.
- Added detailed comments to the `addFilesAndFolders` function for better readability and maintenance.
- ran addFilesAndFolders through eslint and made corrections

This resolves the issue where subfolders with the same name were not being created correctly.

Closes NCEAS#2442
@vchendrix vchendrix force-pushed the issue-2442-hierarchical-view-missing-folders branch from df6d489 to 8dc89ae Compare January 7, 2025 17:56
@vchendrix
Copy link
Collaborator Author

@robyngit @rushirajnenuji Happy New Year! Now that I am familiar with the testing framework, I will see if I can get the linting issues fixed.

@robyngit @rushirajnenuji I have fixed all of the formatting and linting errors. Locally the tests pass for me. However, they seem to still be running in the github action. I am not sure if it is stuck or not.

This addresses issue where the tests hang in gh actions with the
following error

   Run npm test
   > [email protected] test
   > node test/server.js --no-sandbox --disable-setuid-sandbox
   Failed to launch the browser process!
   [2445:2445:0107/191124.327300:FATAL:zygote_host_impl_linux.cc(126)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
@vchendrix
Copy link
Collaborator Author

@robyngit @rushirajnenuji I have updated this PR so that all the tests pass. Please note that I had to make a change to the test server configuration for puppeteer to fix an issue in which the tests were hanging on gh actions.

Please let me know if there are any other issues you would like me to address in order to get this PR merged.

Copy link
Member

@robyngit robyngit left a comment

Choose a reason for hiding this comment

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

Tested this @vchendrix and it fixes the issue on my end. I also tested with other nested & non-nested datasets and found no issues. Thank you for the fix!

@rushirajnenuji, since you're more familiar with this part of the codebase, would you like to take a look at this PR before it's merged?

Copy link
Member

@rushirajnenuji rushirajnenuji left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @vchendrix; and for reviewing and testing this @robyngit. The changes look good to me. 👍🏻

@rushirajnenuji rushirajnenuji merged commit 815fbfb into NCEAS:develop Jan 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hierarchical view incorrectly handling files in a subdirectory

3 participants