Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to main for core #75

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

update to main for core #75

wants to merge 2 commits into from

Conversation

mabels
Copy link
Contributor

@mabels mabels commented Oct 24, 2024

No description provided.

@mabels mabels requested a review from jchris October 24, 2024 12:35
Copy link
Contributor

@jchris jchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let you merge

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note for later -- there's no shared test for these gateways in this repo (unless this PR adds one) and most of this behavior is shared

// }
// if (!dataStore.ebOpts.store.stores.base) {
// throw new Error("Loader stores.base is not defined");
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better

const { store } = getStore(url, this.sthis, (...args) => args.join("/"));

const rParams = url.getParamsResult("uploadUrl", "key", "name");
if (rParams.isErr()) {
return this.logger.Error().Url(url).Err(rParams).Msg("Put Error").ResultError();
}
const { uploadUrl, key, name } = rParams.Ok();
const body = await rt.gw.fpSerialize(this.sthis, fpEnv, url);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧙

@@ -147,34 +140,22 @@ export class AWSGateway implements bs.Gateway {
}
}

private async getData(url: URI): Promise<bs.GetResult> {
async getRaw(url: URI): Promise<Result<Uint8Array>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't listen to many of these yet but the function has theme songs

Screenshot 2024-10-24 at 1 54 21 PM

@@ -52,7 +52,7 @@ export const connect: ConnectFunction = (
return connectionCache.get(urlObj.toString()).once(() => {
makeKeyBagUrlExtractable(sthis);
const connection = connectionFactory(sthis, urlObj);
connection.connect_X(blockstore);
connection.connect(crdt.blockstore);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙂

const connection = rawConnect(db, doc.remoteName, URI.from(doc.endpoint).toString());
const connectURI = URI.from(dashboardURI).build().pathname("/fp/databases/connect");
connectURI.defParam("localName", dbName);
connectURI.defParam("remoteName", doc.remoteName);
if (doc.endpoint) {
connectURI.defParam("endpoint", doc.endpoint);
if (endpoint) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

src/ipfs/index.ts Outdated Show resolved Hide resolved
@@ -85,35 +86,32 @@ export class NetlifyGateway implements bs.Gateway {
return Result.Err(new Error("Remote base URL not found in the URI"));
}
const fetchUrl = BuildURI.from(remoteBaseUrl);
switch (store) {
let body: Uint8Array;
switch (fpenv.type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is easier to work with

base: process.env.FP_STORAGE_URL,
},
storeUrls: {
base: process.env.FP_STORAGE_URL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better!

@jchris
Copy link
Contributor

jchris commented Oct 25, 2024

this should merge first, then merge #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants