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

store parents in the header #202

Merged
merged 14 commits into from
Sep 9, 2024
Merged

store parents in the header #202

merged 14 commits into from
Sep 9, 2024

Conversation

jchris
Copy link
Contributor

@jchris jchris commented Sep 7, 2024

This changes the encoding so all the connectors can support multi-writer easily.

It basically brings what was in the wire encoding for netlify / aws / partykit etc into the core.

@jchris jchris requested a review from mabels September 7, 2024 13:40
@@ -465,3 +508,48 @@ export class WALStoreImpl extends BaseStoreImpl implements WALStore {
return this.gateway.destroy(this.url());
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had trouble with the node module in the smoke test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

).decodeMetaBlocks(bytes);
expect(decodedHeader).toBeDefined();
expect(decodedHeader.cars).toBeDefined();
expect(decodedHeader.cars[0].toString()).toEqual(cid.toString());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

how this is twice as long now... I bet we can flat it to one encoding

Copy link
Contributor Author

@jchris jchris Sep 7, 2024

Choose a reason for hiding this comment

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

I want the cid and parents to be in json, maybe we should just bring the cars up to the json also -- json means we don't need imports in our server code

@jchris
Copy link
Contributor Author

jchris commented Sep 8, 2024

Will make other connectors easier fireproof-storage/connect#7 (comment)

@@ -46,6 +46,7 @@ export class ConnectPartyKit extends Connection {
const base64String = event.data;
const uint8ArrayBuffer = Base64.toUint8Array(base64String);
const eventBlock = await this.decodeEventBlock(uint8ArrayBuffer);
// there should be a callback in the MetaStore that we can call from places like this
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@valorant-dhruv you'll need this when it comes time to listen to the websocket

@jchris jchris merged commit d7c7b7a into main Sep 9, 2024
2 checks passed
@jchris
Copy link
Contributor Author

jchris commented Sep 9, 2024

I think this has what is needed to connect the meta with parent cid tracking

@jchris jchris deleted the parents branch September 20, 2024 20:03
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.

1 participant