metacatui icon indicating copy to clipboard operation
metacatui copied to clipboard

`Metadata: null` when retrieving series DOI link

Open iannesbitt opened this issue 10 months ago • 3 comments

Describe the bug When retrieving a series DOI (for example: doi:10.24431/rw1k8fz), the metadata document returns as Metadata: null. Viewing the same dataset with the exact DOI version link directly does not show this issue (for example: doi:10.24431_rw1k8fz_20241021T144253Z.

Using the Inspector to disable using cached data seems to solve this issue, and everything loads just fine.

To Reproduce Steps to reproduce the behavior:

  1. Go to doi:10.24431/rw1k8fz
  2. Scroll down to Files and Folders
  3. See Metadata: null error
  4. If no error appears, refresh and return to step 3.
  5. Open Inspector and check Disable Cache Screen Shot 2024-12-30 at 15 09 43
  6. Refresh page
  7. Metadata document should populate ok

Expected behavior Metadata document should load at all times

Screenshots If applicable, add screenshots to help explain your problem. Screen Shot 2024-12-30 at 11 18 23 Screen Shot 2024-12-30 at 11 19 05

Desktop (please complete the following information):

  • OS: Mac OS
  • Browser: Firefox
  • Version: 133.0

iannesbitt avatar Dec 30 '24 23:12 iannesbitt

This was reported in Slack: https://dataoneorg.slack.com/archives/C2ASPD868/p1735581601890769

iannesbitt avatar Dec 30 '24 23:12 iannesbitt

This is consistent across multiple browsers and versions for me (FF, Brave, Safari).

I spent a few minutes in the javascript debugger with this, and found out a few interesting tidbits.

  • The fileName attribute in the model is indeed null after exiting the block on line 245 of DataItemView.js
  • Backtracing this to where that data comes from, I went all the way back to where the data package is loaded on line 216 of MetadataView.js
    • 216 const dataOneObject = new ScienceMetadata({ id: this.model.get("id") });

When I set a breakpoint on line 216 and execute that line, I see that fileName is null:

  • dataOneObject.attributes.fileName: null

Interestingly, after setting that breakpoint and inspecting the property, if I then hit "Continue" in the debugger, then the property gets filled in and displays the title in the UI without a problem. But, if I don't stop in the debugger, then the Metadata: null shows up in the UI. So, there seems to be a timing issue where the values are not populated yet at render time, but delaying a second or so allows them to get filled in. As @iannesbitt said, it only seems to happen when the Cache is not disabled. Here's a quick video showing the effect:

https://github.com/user-attachments/assets/7de1f2bd-86e6-40e0-a988-286cda6504c5

mbjones avatar Dec 31 '24 00:12 mbjones

Thanks for the report and investigation @iannesbitt and @mbjones! @rushirajnenuji, does this tie in with any of the other intermittent hierarchical data package bugs? Maybe the root cause is the same?

robyngit avatar Jan 06 '25 15:01 robyngit