Skip to content

Refactor editor save/update behaviour to use promise-based utilities #2805

@robyngit

Description

@robyngit

This PR will connect the new lower-level classes from #2804 to the editor save behaviour so dataset submission and update handling are more reliable.

Right now, editor saving is coordinated across DataPackage, DataONEObject, EML211, and related models using listeners, callbacks, and upload-status flags. That makes it difficult to reason about failure cases and is a likely cause of several bugs we are seeing with dataset submissions.

This PR will introduce a new orchestration layer for package writes and use it to replace the current listener-driven save/update process.

This PR will include:

  • A new DataPackageService class to coordinate package write operations.
  • A promise-based save/update flow for packages that performs operations in a defined order:
    • data object creates/replacements
    • metadata create/replacement
    • resource map create/replacement
  • Clear failure behaviour so the package save stops at the correct stage instead of continuing after partial failure.
  • Resource map validation before submission.
  • Improved network and submission error handling so failures are surfaced more clearly to the user.
  • Refactoring of the current editor save path to delegate transport, sysmeta updates, and package write orchestration to DataPackageService.
  • Reduced responsibility in DataPackage for serialization, transport, and workflow coordination.
  • Unit tests for the new orchestration logic and failure scenarios.

The purpose of this PR is to make saving and updating data packages more deterministic and testable, and less likely to leave datasets in a broken partial state.

Metadata

Metadata

Assignees

Labels

ADC CI-09Enhanced data submission tools & portals (ADC deliverable)arctic data centereditorsubmission & error handlingProblems surrounding failed metadata submissions in the editor

Type

Projects

Status

No status

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions