{"record":{"id":"2fd20261ff12b024","repo":"hcengineering/platform","slug":"not-implemented-2fd202","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"foundations/stream/internal/pkg/mediaconvert/stream.go","lineNumber":147,"sourceCode":"\t\t\t}\n\t\t}()\n\t}\n\n\twg.Wait()\n\n\t// Signal that the stream is done\n\tclose(w.done)\n\n\treturn nil\n}\n\n// ConcatUploads calls when upload resumed after fail\nfunc (w *Stream) ConcatUploads(ctx context.Context, partialUploads []handler.Upload) error {\n\tw.logger.Debug(\"ConcatUploads was executed, it's not implemented\")\n\t//\n\t// TODO: load raw source from the Buckup bucket, terminate all Streams with same ID and start process again.\n\t//\n\treturn errors.New(\"not implemented\")\n}\n\n// FinishUpload calls when upload finished without errors on the client side\nfunc (w *Stream) FinishUpload(ctx context.Context) error {\n\tctx, span := tracer.Start(ctx, \"FinishUpload\", trace.WithAttributes(\n\t\tattribute.String(\"workspace\", w.info.MetaData[\"workspace\"]),\n\t\tattribute.String(\"upload_id\", w.info.ID),\n\t))\n\tdefer span.End()\n\n\tw.logger.Debug(\"finish upload\")\n\n\t// Close the writer first to signal EOF to all readers\n\tif err := w.writer.Close(); err != nil {\n\t\ttracing.RecordError(span, err)\n\t\tw.logger.Error(\"failed to close writer\", zap.Error(err))\n\t\treturn err\n\t}","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/foundations/stream/internal/pkg/mediaconvert/stream.go#L129-L165","documentation":"Stream.ConcatUploads is invoked by tus/resumable-upload flows when an upload resumes after a failure and existing partial uploads must be concatenated. This implementation deliberately returns 'not implemented' — resumption from partial uploads is unsupported; the TODO says the intended behavior is reloading the raw source from the backup bucket, terminating same-ID streams, and restarting processing.","triggerScenarios":"A tus upload is interrupted and the client resumes, causing the handler to call ConcatUploads with partial uploads; upload retry/recovery paths reaching Stream after a network failure mid-transfer.","commonSituations":"Unstable client networks interrupting large uploads; server restarts mid-upload followed by client resume; automated retry policies on the client that assume concat/resume works.","solutions":["Do not rely on resume for Stream uploads — restart the upload from the beginning on failure","Implement the TODO: recover raw source from the backup bucket, terminate streams with the same ID, and re-run processing","Configure the tus client to not attempt concat-style resume with this backend (offset restart instead)","If resumability is required, use a storage backend whose ConcatUploads is implemented"],"exampleFix":"// before\nclient.resume(uploadID) // server hits ConcatUploads -> not implemented\n// after\nclient.terminate(uploadID)\nclient.startFreshUpload(file)","handlingStrategy":"fallback","validationCode":"// avoid triggering resume path: detect prior partial upload client-side\nconst state = await fetch(`${tusURL}/${uploadID}`)\nif (state.status === 200 && needsConcatRecovery) {\n  await terminateUpload(uploadID) // restart fresh\n}","typeGuard":null,"tryCatchPattern":"if err := stream.ConcatUploads(ctx, partials); err != nil {\n    if err.Error() == \"not implemented\" {\n        // restart processing from backup source instead\n        return restartFromBackup(ctx, uploadID)\n    }\n    return err\n}","preventionTips":["Disable client-side resume/concat for this backend; restart uploads instead","Handle network interruptions by aborting and re-uploading from byte 0","If resumability matters, implement the backup-bucket recovery in Stream","Monitor for 'ConcatUploads was executed' debug logs to detect resume attempts"],"tags":["upload","resumable","tus","not-implemented","go"],"backgroundTag":"resumable-upload-not-supported","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}