diff --git a/core/ipfs/utils.go b/core/ipfs/utils.go index 482fa4cc..effdd159 100644 --- a/core/ipfs/utils.go +++ b/core/ipfs/utils.go @@ -81,5 +81,9 @@ func DownloadIpfsItem(ctx context.Context, gatewayUrl string, cid cid.Cid) (io.R return nil, err } + if resp.StatusCode != 200 { + return nil, fmt.Errorf("failed to fetch item: status_code %d", resp.StatusCode) + } + return resp.Body, nil } diff --git a/core/space/services/services_fs.go b/core/space/services/services_fs.go index ea9d547e..3e0784a4 100644 --- a/core/space/services/services_fs.go +++ b/core/space/services/services_fs.go @@ -220,8 +220,8 @@ func (s *Space) listDirAtPath( SizeInBytes: strconv.FormatInt(item.Size, 10), FileExtension: strings.Replace(filepath.Ext(item.Name), ".", "", -1), // FIXME: real created at needed - Created: time.Unix(item.Metadata.UpdatedAt, 0).Format(time.RFC3339), - Updated: time.Unix(item.Metadata.UpdatedAt, 0).Format(time.RFC3339), + Created: time.Unix(0, item.Metadata.UpdatedAt).Format(time.RFC3339), + Updated: time.Unix(0, item.Metadata.UpdatedAt).Format(time.RFC3339), Members: members, }, IpfsHash: item.Cid, diff --git a/core/textile/model/received_file.go b/core/textile/model/received_file.go index c7254e93..dc770ea2 100644 --- a/core/textile/model/received_file.go +++ b/core/textile/model/received_file.go @@ -106,6 +106,9 @@ func (m *model) CreateReceivedFileViaPublicLink( FileName: filename, FileSize: fileSize, }, + ReceivedFileViaInvitationSchema: ReceivedFileViaInvitationSchema{ + EncryptionKey: []byte(""), + }, Accepted: accepted, CreatedAt: time.Now().UnixNano(), } diff --git a/core/textile/sharing.go b/core/textile/sharing.go index 2167bfdc..fb5aabb1 100644 --- a/core/textile/sharing.go +++ b/core/textile/sharing.go @@ -219,8 +219,8 @@ func (tc *textileClient) buildPublicLinkSharedDirEntry( Name: file.FileName, SizeInBytes: file.FileSize, FileExtension: strings.Replace(filepath.Ext(file.FileName), ".", "", -1), - Created: strconv.FormatInt(time.Unix(0, file.CreatedAt).Unix(), 10), - Updated: strconv.FormatInt(time.Unix(0, file.CreatedAt).Unix(), 10), + Created: time.Unix(0, file.CreatedAt).Format(time.RFC3339), + Updated: time.Unix(0, file.CreatedAt).Format(time.RFC3339), }, }, Members: []domain.Member{}, @@ -301,8 +301,8 @@ func (tc *textileClient) buildInvitationSharedDirEntry( Name: name, SizeInBytes: strconv.FormatInt(size, 10), FileExtension: ext, - Created: strconv.FormatInt(time.Unix(0, file.CreatedAt).Unix(), 10), - Updated: strconv.FormatInt(time.Unix(updatedAt, 0).Unix(), 10), + Created: time.Unix(0, file.CreatedAt).Format(time.RFC3339), + Updated: time.Unix(0, updatedAt).Format(time.RFC3339), }, }, Members: members,