Skip to main content
Version: 1.8.0

fix-missing-fileid

🐛 Bug Fixes​

Require fileId on legacy document create unless the agent is iptower​

Goal: Legacy POST /documents must not create a deposit without a linked upload, except for Tower. Clients that already send fileId or idUpload without Bcyip-Agent must keep working.

Solution: Return 400 when the file reference is missing and the header is absent, ipmagicbox, or any agent other than iptower (case-insensitive). When a reference is present, require a RemoteFile that belongs to the job, matches the hash, and is not already linked.

Features:

  • Bcyip-Agent: iptower → file reference optional
  • No header or any other agent → fileId / idUpload required
  • Provided reference is checked before the document is kept

Files Modified:

  • app/util/documentIngest.js - fileId requirement, header not required
  • app/routes/documents.js - Validate before create
  • app/services/documents.js - RemoteFile ownership, hash, and link checks