Skip to content

Handle missing file history when listing virology results to import - #1008

Merged
labkey-martyp merged 1 commit into
release26.3-SNAPSHOTfrom
26.3_fb_virology_file_history
Aug 14, 2026
Merged

Handle missing file history when listing virology results to import#1008
labkey-martyp merged 1 commit into
release26.3-SNAPSHOTfrom
26.3_fb_virology_file_history

Conversation

@labkey-martyp

Copy link
Copy Markdown
Contributor

Rationale

The "Import Results from File" list in the virology results grid could fail to render. Each candidate file's upload date comes from a webdav file-history lookup, and two paths through that lookup were broken: a file with no file system audit record threw on history[0].data.date, and the lookup's own failure callback called an undefined reject, throwing a ReferenceError instead of rejecting. Either one rejected the enclosing Promise.all, which had no rejection handler, so the window stayed behind a "Loading..." mask with no error shown.

Related Pull Requests

None.

Changes

  • getFileHistory resolves instead of rejecting on a failed lookup, so one unreadable file no longer drops the whole import list.
  • Guarded the empty-history case; those files report their upload date as Unknown rather than a substituted timestamp.
  • Added a rejection handler to the Promise.all so failures hide the loading mask and surface an alert.
  • getFileHistory resolves {name, uploaded} rather than a positional [filename, history] pair.

The failure callback in getFileHistory called reject, which was never destructured from the promise executor, so a failed history lookup threw a ReferenceError instead of rejecting. It now logs and resolves so one unreadable file no longer drops the entire import list.

A file placed on the server outside of an upload has no file system audit record, so history[0].data.date threw. Those rows now report their upload date as Unknown rather than substituting an unrelated timestamp.

Promise.all had no rejection handler, so any failure left the Loading mask up with no feedback. It now hides the mask and alerts.
@guyinco6nito guyinco6nito self-assigned this Aug 13, 2026

@guyinco6nito guyinco6nito left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great to me, I see no benefit to having this crash when the history is blank. Approved! -Dan Metzger

@labkey-martyp
labkey-martyp merged commit 2b7e2e8 into release26.3-SNAPSHOT Aug 14, 2026
7 of 11 checks passed
@labkey-martyp
labkey-martyp deleted the 26.3_fb_virology_file_history branch August 14, 2026 16:51
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.

3 participants