Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
S3 getSignedUrl now returns 'key' instead of 'Key'
Browse files Browse the repository at this point in the history
Updated all storage providers to match this.
  • Loading branch information
barankyle committed Jul 21, 2023
1 parent 46a548e commit 2736974
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/engine/src/ecs/functions/ComponentFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Subscribable, subscribable } from '@hookstate/subscribable'
import * as bitECS from 'bitecs'
// tslint:disable:ordered-imports
import type from 'react/experimental'
import React, { startTransition, useEffect, useLayoutEffect } from 'react'
import React, { startTransition, use, useEffect, useLayoutEffect } from 'react'

import config from '@etherealengine/common/src/config'
import { DeepReadonly } from '@etherealengine/common/src/DeepReadonly'
Expand Down Expand Up @@ -507,7 +507,7 @@ export function useComponent<C extends Component<any>>(entity: Entity, Component
}

// use() will suspend the component (by throwing a promise) and resume when the promise is resolved
_use(promiseResolver.promise)
;(use ?? _use)(promiseResolver.promise)

return useHookstate(Component.stateMap[entity]) as any as State<ComponentType<C>> // todo fix any cast
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class IPFSStorage implements StorageProviderInterface {
async getSignedUrl(key: string, _expiresAfter: number, _conditions: any) {
const url = await this._getUrl(key)
return {
fields: { Key: key },
fields: { key: key },
url,
local: false,
cacheDomain: this.cacheDomain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class LocalStorage implements StorageProviderInterface {
*/
getSignedUrl = (key: string, _expiresAfter: number, _conditions): any => {
return {
fields: { Key: key },
fields: { key: key },
url: `https://${this.cacheDomain}`,
local: true,
cacheDomain: this.cacheDomain
Expand Down Expand Up @@ -306,7 +306,7 @@ export class LocalStorage implements StorageProviderInterface {
res.type = path.extname(res.key).substring(1) // remove '.' from extension
res.name = path.basename(res.key, '.' + res.type)
res.size = this._formatBytes(fs.lstatSync(pathString).size)
res.url = signedUrl.url + path.sep + signedUrl.fields.Key
res.url = signedUrl.url + path.sep + signedUrl.fields.key
}

return res
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('storageprovider', () => {
})
let res
try {
res = await fetch(signedUrl.url + signedUrl.fields.Key, { agent: httpAgent })
res = await fetch(signedUrl.url + signedUrl.fields.key, { agent: httpAgent })
} catch (err) {
console.log(err)
}
Expand Down

0 comments on commit 2736974

Please sign in to comment.