Skip to content

Metadata for Seqdev Workspaces - Managed fields and Read-only flag #1804

@dandelany

Description

@dandelany

Summary

Follow up to #1802, which established the base SeqDev metadata structure + API. Implement enforcement of readOnly metadata flag and automatic management of managed metadata fields.

Includes

  • Read-only file enforcement
  • Automatic updates to managed metadata (createdBy/createdAt/lastEditedBy/lastEditedAt)
  • Integration with Workspace Service file operations

Read-Only Enforcement

Existing workspace file operations must be updated to check if the file metadata's readOnly flag is set before executing the operation. Specifically, if a file's metadata contains:

"readOnly": true
  • Workspace Service must reject file operations that mutate the file.
  • This includes: File write, rename, move or delete, either individually or as a part of a bulk operation.
  • These operations should still be allowed for files with this flag: Read file, Read metadata, Update metadata (including disabling readOnly), Copy file, or anything else which does not modify the underlying file.
  • readOnly can be assumed to be false if the file has no metadata or the readOnly key is absent.

Managed Metadata Fields

The Workspace Service should automatically manage the following metadata fields. These fields are service-controlled and cannot be modified through the Metadata API.

Field Description
createdBy Username of user who created the file
createdAt Timestamp of file creation
lastEditedBy Last user who modified file
lastEditedAt Timestamp of last modification
  • All timestamps should be ISO 8601 timestamp format eg. 2026-03-17T00:09:34.075Z
  • createdBy and createdAt should be set automatically when the file is first created or uploaded.
    • createdBy should be the username from the user's auth token
    • createdAt should be the creation time (of the underlying file, not the metadata file)
  • Likewise, lastEditedBy/lastEditedAt are updated whenever the file is updated.
    • These fields are updated only when the file contents change, not when metadata is modified.
  • Clients should not be able set these fields directly in a metadata API call, they should be entirely managed by us.

Metadata Creation

Metadata files are created lazily, and may not exist yet when these operations are called. We should automatically create metadata files whenever:

  • A new file is created - create metadata file populated with managed fields and readOnly: false.
  • A file is modified - if metadata is missing, create a new metadata file with managed fields and fill them in as if the file was just created (createdAt: <now>)
  • Metadata is set/updated - if metadata is missing, same thing, create it with fresh timestamp.

For V1, consistency between file and metadata during rename/move/copy/delete is best-effort only. We should try hard not to fail in a way that orphans metadata files, but ultimately paired file + metadata operations are not 100% atomic or crash-safe.

Metadata

Metadata

Assignees

Labels

4.2.0featureA new feature or feature requestsequencingAnything related to the sequencing domain

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions